So, I am trying to create a mod (my knowledge of java at this point is very little), and I am trying to make a Interact Event that will do a bunch of things to a player. However, it does not seem to be working.
I'm not sure if I have put the code in the wrong place, or I have just used a wrong function (the lines are currently in the item's class). If someone could help me out with this, I would appreciate it!
Another problem I am having is with the textures of my blocks and items. I am fairly sure I have the code right, I think I have just placed the files in the wrong location, however, I cannot figure it out (C:\<forgedirectory>\src\main\resources\assets\themod\textures\<blocks/items>).
[spoiler=Block]
package me.ryancp.mod;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.IIcon;
public class BlockTest extends Block {
@SideOnly(Side.CLIENT)
protected IIcon blockIcon;
protected IIcon blockIconTop;
protected BlockTest() {
super(Material.ground);
this.setCreativeTab(TheMod.tabMod);
}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister p_149651_1_)
{
blockIcon = p_149651_1_.registerIcon(TheMod.MODID + ":" + this.getUnlocalizedName().substring(5));
blockIconTop = p_149651_1_.registerIcon(TheMod.MODID + ":" + this.getUnlocalizedName().substring(5) + "Top");
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int metadata)
{
if (side == 1) {
return blockIconTop;
} else {
return blockIcon;
}
}
}
If someone can help me with both of these problems, I would be most grateful!