package portables.common.items; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import portables.common.core.SimplePortables; import java.util.List; public class PortableItem extends Item { public static int durability; public PortableItem() { super(); setUnlocalizedName("portableItem"); setTextureName("simpleportables:portableItem"); setCreativeTab(SimplePortables.creativeTab); setFull3D(); setMaxStackSize(1); setMaxDamage(durability); } @SuppressWarnings({ "unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack item, EntityPlayer player, List list, boolean par4) { list.add("Ender Chest"); list.add("Enchanting Table"); list.add("Crafting Table"); list.add("Anvil"); } @Override public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { FMLNetworkHandler.openGui(player, SimplePortables.instance, 0, world, 0, 0, 0); return item; } @Override public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return Block.getIdFromBlock(Blocks.gold_block) == Item.getIdFromItem(par2ItemStack.getItem()) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } }