    001package net.minecraft.item;
    002
    003import cpw.mods.fml.common.registry.GameData;
    004import cpw.mods.fml.relauncher.Side;
    005import cpw.mods.fml.relauncher.SideOnly;
    006import java.util.List;
    007import java.util.Random;
    008import net.minecraft.block.Block;
    009import net.minecraft.block.material.Material;
    010import net.minecraft.creativetab.CreativeTabs;
    011import net.minecraft.entity.Entity;
    012import net.minecraft.entity.EntityLiving;
    013import net.minecraft.entity.item.EntityItemFrame;
    014import net.minecraft.entity.item.EntityPainting;
    015import net.minecraft.entity.player.EntityPlayer;
    016import net.minecraft.entity.player.EntityPlayerMP;
    017import net.minecraft.potion.Potion;
    018import net.minecraft.potion.PotionHelper;
    019import net.minecraft.stats.StatList;
    020import net.minecraft.util.MathHelper;
    021import net.minecraft.util.MovingObjectPosition;
    022import net.minecraft.util.StatCollector;
    023import net.minecraft.util.StringTranslate;
    024import net.minecraft.util.Vec3;
    025import net.minecraft.util.WeightedRandomChestContent;
    026import net.minecraft.world.World;
    027import net.minecraftforge.common.ChestGenHooks;
    028
    029public class Item
    030{
    031    private CreativeTabs tabToDisplayOn = null;
    032
    033    /** The RNG used by the Item subclasses. */
    034    protected static Random itemRand = new Random();
    035
    036    /** A 32000 elements Item array. */
    037    public static Item[] itemsList = new Item[32000];
    038    public static Item shovelSteel = (new ItemSpade(0, EnumToolMaterial.IRON)).setIconCoord(2, 5).setItemName("shovelIron");
    039    public static Item pickaxeSteel = (new ItemPickaxe(1, EnumToolMaterial.IRON)).setIconCoord(2, 6).setItemName("pickaxeIron");
    040    public static Item axeSteel = (new ItemAxe(2, EnumToolMaterial.IRON)).setIconCoord(2, 7).setItemName("hatchetIron");
    041    public static Item flintAndSteel = (new ItemFlintAndSteel(3)).setIconCoord(5, 0).setItemName("flintAndSteel");
    042    public static Item appleRed = (new ItemFood(4, 4, 0.3F, false)).setIconCoord(10, 0).setItemName("apple");
    043    public static Item bow = (new ItemBow(5)).setIconCoord(5, 1).setItemName("bow");
    044    public static Item arrow = (new Item(6)).setIconCoord(5, 2).setItemName("arrow").setCreativeTab(CreativeTabs.tabCombat);
    045    public static Item coal = (new ItemCoal(7)).setIconCoord(7, 0).setItemName("coal");
    046    public static Item diamond = (new Item(8)).setIconCoord(7, 3).setItemName("diamond").setCreativeTab(CreativeTabs.tabMaterials);
    047    public static Item ingotIron = (new Item(9)).setIconCoord(7, 1).setItemName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials);
    048    public static Item ingotGold = (new Item(10)).setIconCoord(7, 2).setItemName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials);
    049    public static Item swordSteel = (new ItemSword(11, EnumToolMaterial.IRON)).setIconCoord(2, 4).setItemName("swordIron");
    050    public static Item swordWood = (new ItemSword(12, EnumToolMaterial.WOOD)).setIconCoord(0, 4).setItemName("swordWood");
    051    public static Item shovelWood = (new ItemSpade(13, EnumToolMaterial.WOOD)).setIconCoord(0, 5).setItemName("shovelWood");
    052    public static Item pickaxeWood = (new ItemPickaxe(14, EnumToolMaterial.WOOD)).setIconCoord(0, 6).setItemName("pickaxeWood");
    053    public static Item axeWood = (new ItemAxe(15, EnumToolMaterial.WOOD)).setIconCoord(0, 7).setItemName("hatchetWood");
    054    public static Item swordStone = (new ItemSword(16, EnumToolMaterial.STONE)).setIconCoord(1, 4).setItemName("swordStone");
    055    public static Item shovelStone = (new ItemSpade(17, EnumToolMaterial.STONE)).setIconCoord(1, 5).setItemName("shovelStone");
    056    public static Item pickaxeStone = (new ItemPickaxe(18, EnumToolMaterial.STONE)).setIconCoord(1, 6).setItemName("pickaxeStone");
    057    public static Item axeStone = (new ItemAxe(19, EnumToolMaterial.STONE)).setIconCoord(1, 7).setItemName("hatchetStone");
    058    public static Item swordDiamond = (new ItemSword(20, EnumToolMaterial.EMERALD)).setIconCoord(3, 4).setItemName("swordDiamond");
    059    public static Item shovelDiamond = (new ItemSpade(21, EnumToolMaterial.EMERALD)).setIconCoord(3, 5).setItemName("shovelDiamond");
    060    public static Item pickaxeDiamond = (new ItemPickaxe(22, EnumToolMaterial.EMERALD)).setIconCoord(3, 6).setItemName("pickaxeDiamond");
    061    public static Item axeDiamond = (new ItemAxe(23, EnumToolMaterial.EMERALD)).setIconCoord(3, 7).setItemName("hatchetDiamond");
    062    public static Item stick = (new Item(24)).setIconCoord(5, 3).setFull3D().setItemName("stick").setCreativeTab(CreativeTabs.tabMaterials);
    063    public static Item bowlEmpty = (new Item(25)).setIconCoord(7, 4).setItemName("bowl").setCreativeTab(CreativeTabs.tabMaterials);
    064    public static Item bowlSoup = (new ItemSoup(26, 6)).setIconCoord(8, 4).setItemName("mushroomStew");
    065    public static Item swordGold = (new ItemSword(27, EnumToolMaterial.GOLD)).setIconCoord(4, 4).setItemName("swordGold");
    066    public static Item shovelGold = (new ItemSpade(28, EnumToolMaterial.GOLD)).setIconCoord(4, 5).setItemName("shovelGold");
    067    public static Item pickaxeGold = (new ItemPickaxe(29, EnumToolMaterial.GOLD)).setIconCoord(4, 6).setItemName("pickaxeGold");
    068    public static Item axeGold = (new ItemAxe(30, EnumToolMaterial.GOLD)).setIconCoord(4, 7).setItemName("hatchetGold");
    069    public static Item silk = (new ItemReed(31, Block.tripWire)).setIconCoord(8, 0).setItemName("string").setCreativeTab(CreativeTabs.tabMaterials);
    070    public static Item feather = (new Item(32)).setIconCoord(8, 1).setItemName("feather").setCreativeTab(CreativeTabs.tabMaterials);
    071    public static Item gunpowder = (new Item(33)).setIconCoord(8, 2).setItemName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials);
    072    public static Item hoeWood = (new ItemHoe(34, EnumToolMaterial.WOOD)).setIconCoord(0, 8).setItemName("hoeWood");
    073    public static Item hoeStone = (new ItemHoe(35, EnumToolMaterial.STONE)).setIconCoord(1, 8).setItemName("hoeStone");
    074    public static Item hoeSteel = (new ItemHoe(36, EnumToolMaterial.IRON)).setIconCoord(2, 8).setItemName("hoeIron");
    075    public static Item hoeDiamond = (new ItemHoe(37, EnumToolMaterial.EMERALD)).setIconCoord(3, 8).setItemName("hoeDiamond");
    076    public static Item hoeGold = (new ItemHoe(38, EnumToolMaterial.GOLD)).setIconCoord(4, 8).setItemName("hoeGold");
    077    public static Item seeds = (new ItemSeeds(39, Block.crops.blockID, Block.tilledField.blockID)).setIconCoord(9, 0).setItemName("seeds");
    078    public static Item wheat = (new Item(40)).setIconCoord(9, 1).setItemName("wheat").setCreativeTab(CreativeTabs.tabMaterials);
    079    public static Item bread = (new ItemFood(41, 5, 0.6F, false)).setIconCoord(9, 2).setItemName("bread");
    080    public static Item helmetLeather = (new ItemArmor(42, EnumArmorMaterial.CLOTH, 0, 0)).setIconCoord(0, 0).setItemName("helmetCloth");
    081    public static Item plateLeather = (new ItemArmor(43, EnumArmorMaterial.CLOTH, 0, 1)).setIconCoord(0, 1).setItemName("chestplateCloth");
    082    public static Item legsLeather = (new ItemArmor(44, EnumArmorMaterial.CLOTH, 0, 2)).setIconCoord(0, 2).setItemName("leggingsCloth");
    083    public static Item bootsLeather = (new ItemArmor(45, EnumArmorMaterial.CLOTH, 0, 3)).setIconCoord(0, 3).setItemName("bootsCloth");
    084    public static Item helmetChain = (new ItemArmor(46, EnumArmorMaterial.CHAIN, 1, 0)).setIconCoord(1, 0).setItemName("helmetChain");
    085    public static Item plateChain = (new ItemArmor(47, EnumArmorMaterial.CHAIN, 1, 1)).setIconCoord(1, 1).setItemName("chestplateChain");
    086    public static Item legsChain = (new ItemArmor(48, EnumArmorMaterial.CHAIN, 1, 2)).setIconCoord(1, 2).setItemName("leggingsChain");
    087    public static Item bootsChain = (new ItemArmor(49, EnumArmorMaterial.CHAIN, 1, 3)).setIconCoord(1, 3).setItemName("bootsChain");
    088    public static Item helmetSteel = (new ItemArmor(50, EnumArmorMaterial.IRON, 2, 0)).setIconCoord(2, 0).setItemName("helmetIron");
    089    public static Item plateSteel = (new ItemArmor(51, EnumArmorMaterial.IRON, 2, 1)).setIconCoord(2, 1).setItemName("chestplateIron");
    090    public static Item legsSteel = (new ItemArmor(52, EnumArmorMaterial.IRON, 2, 2)).setIconCoord(2, 2).setItemName("leggingsIron");
    091    public static Item bootsSteel = (new ItemArmor(53, EnumArmorMaterial.IRON, 2, 3)).setIconCoord(2, 3).setItemName("bootsIron");
    092    public static Item helmetDiamond = (new ItemArmor(54, EnumArmorMaterial.DIAMOND, 3, 0)).setIconCoord(3, 0).setItemName("helmetDiamond");
    093    public static Item plateDiamond = (new ItemArmor(55, EnumArmorMaterial.DIAMOND, 3, 1)).setIconCoord(3, 1).setItemName("chestplateDiamond");
    094    public static Item legsDiamond = (new ItemArmor(56, EnumArmorMaterial.DIAMOND, 3, 2)).setIconCoord(3, 2).setItemName("leggingsDiamond");
    095    public static Item bootsDiamond = (new ItemArmor(57, EnumArmorMaterial.DIAMOND, 3, 3)).setIconCoord(3, 3).setItemName("bootsDiamond");
    096    public static Item helmetGold = (new ItemArmor(58, EnumArmorMaterial.GOLD, 4, 0)).setIconCoord(4, 0).setItemName("helmetGold");
    097    public static Item plateGold = (new ItemArmor(59, EnumArmorMaterial.GOLD, 4, 1)).setIconCoord(4, 1).setItemName("chestplateGold");
    098    public static Item legsGold = (new ItemArmor(60, EnumArmorMaterial.GOLD, 4, 2)).setIconCoord(4, 2).setItemName("leggingsGold");
    099    public static Item bootsGold = (new ItemArmor(61, EnumArmorMaterial.GOLD, 4, 3)).setIconCoord(4, 3).setItemName("bootsGold");
    100    public static Item flint = (new Item(62)).setIconCoord(6, 0).setItemName("flint").setCreativeTab(CreativeTabs.tabMaterials);
    101    public static Item porkRaw = (new ItemFood(63, 3, 0.3F, true)).setIconCoord(7, 5).setItemName("porkchopRaw");
    102    public static Item porkCooked = (new ItemFood(64, 8, 0.8F, true)).setIconCoord(8, 5).setItemName("porkchopCooked");
    103    public static Item painting = (new ItemHangingEntity(65, EntityPainting.class)).setIconCoord(10, 1).setItemName("painting");
    104    public static Item appleGold = (new ItemAppleGold(66, 4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 0, 1.0F).setIconCoord(11, 0).setItemName("appleGold");
    105    public static Item sign = (new ItemSign(67)).setIconCoord(10, 2).setItemName("sign");
    106    public static Item doorWood = (new ItemDoor(68, Material.wood)).setIconCoord(11, 2).setItemName("doorWood");
    107    public static Item bucketEmpty = (new ItemBucket(69, 0)).setIconCoord(10, 4).setItemName("bucket").setMaxStackSize(16);
    108    public static Item bucketWater = (new ItemBucket(70, Block.waterMoving.blockID)).setIconCoord(11, 4).setItemName("bucketWater").setContainerItem(bucketEmpty);
    109    public static Item bucketLava = (new ItemBucket(71, Block.lavaMoving.blockID)).setIconCoord(12, 4).setItemName("bucketLava").setContainerItem(bucketEmpty);
    110    public static Item minecartEmpty = (new ItemMinecart(72, 0)).setIconCoord(7, 8).setItemName("minecart");
    111    public static Item saddle = (new ItemSaddle(73)).setIconCoord(8, 6).setItemName("saddle");
    112    public static Item doorSteel = (new ItemDoor(74, Material.iron)).setIconCoord(12, 2).setItemName("doorIron");
    113    public static Item redstone = (new ItemRedstone(75)).setIconCoord(8, 3).setItemName("redstone").setPotionEffect(PotionHelper.redstoneEffect);
    114    public static Item snowball = (new ItemSnowball(76)).setIconCoord(14, 0).setItemName("snowball");
    115    public static Item boat = (new ItemBoat(77)).setIconCoord(8, 8).setItemName("boat");
    116    public static Item leather = (new Item(78)).setIconCoord(7, 6).setItemName("leather").setCreativeTab(CreativeTabs.tabMaterials);
    117    public static Item bucketMilk = (new ItemBucketMilk(79)).setIconCoord(13, 4).setItemName("milk").setContainerItem(bucketEmpty);
    118    public static Item brick = (new Item(80)).setIconCoord(6, 1).setItemName("brick").setCreativeTab(CreativeTabs.tabMaterials);
    119    public static Item clay = (new Item(81)).setIconCoord(9, 3).setItemName("clay").setCreativeTab(CreativeTabs.tabMaterials);
    120    public static Item reed = (new ItemReed(82, Block.reed)).setIconCoord(11, 1).setItemName("reeds").setCreativeTab(CreativeTabs.tabMaterials);
    121    public static Item paper = (new Item(83)).setIconCoord(10, 3).setItemName("paper").setCreativeTab(CreativeTabs.tabMisc);
    122    public static Item book = (new ItemBook(84)).setIconCoord(11, 3).setItemName("book").setCreativeTab(CreativeTabs.tabMisc);
    123    public static Item slimeBall = (new Item(85)).setIconCoord(14, 1).setItemName("slimeball").setCreativeTab(CreativeTabs.tabMisc);
    124    public static Item minecartCrate = (new ItemMinecart(86, 1)).setIconCoord(7, 9).setItemName("minecartChest");
    125    public static Item minecartPowered = (new ItemMinecart(87, 2)).setIconCoord(7, 10).setItemName("minecartFurnace");
    126    public static Item egg = (new ItemEgg(88)).setIconCoord(12, 0).setItemName("egg");
    127    public static Item compass = (new Item(89)).setIconCoord(6, 3).setItemName("compass").setCreativeTab(CreativeTabs.tabTools);
    128    public static Item fishingRod = (new ItemFishingRod(90)).setIconCoord(5, 4).setItemName("fishingRod");
    129    public static Item pocketSundial = (new Item(91)).setIconCoord(6, 4).setItemName("clock").setCreativeTab(CreativeTabs.tabTools);
    130    public static Item lightStoneDust = (new Item(92)).setIconCoord(9, 4).setItemName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials);
    131    public static Item fishRaw = (new ItemFood(93, 2, 0.3F, false)).setIconCoord(9, 5).setItemName("fishRaw");
    132    public static Item fishCooked = (new ItemFood(94, 5, 0.6F, false)).setIconCoord(10, 5).setItemName("fishCooked");
    133    public static Item dyePowder = (new ItemDye(95)).setIconCoord(14, 4).setItemName("dyePowder");
    134    public static Item bone = (new Item(96)).setIconCoord(12, 1).setItemName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc);
    135    public static Item sugar = (new Item(97)).setIconCoord(13, 0).setItemName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials);
    136    public static Item cake = (new ItemReed(98, Block.cake)).setMaxStackSize(1).setIconCoord(13, 1).setItemName("cake").setCreativeTab(CreativeTabs.tabFood);
    137    public static Item bed = (new ItemBed(99)).setMaxStackSize(1).setIconCoord(13, 2).setItemName("bed");
    138    public static Item redstoneRepeater = (new ItemReed(100, Block.redstoneRepeaterIdle)).setIconCoord(6, 5).setItemName("diode").setCreativeTab(CreativeTabs.tabRedstone);
    139    public static Item cookie = (new ItemFood(101, 2, 0.1F, false)).setIconCoord(12, 5).setItemName("cookie");
    140    public static ItemMap map = (ItemMap)(new ItemMap(102)).setIconCoord(12, 3).setItemName("map");
    141
    142    /**
    143     * Item introduced on 1.7 version, is a shear to cut leaves (you can keep the block) or get wool from sheeps.
    144     */
    145    public static ItemShears shears = (ItemShears)(new ItemShears(103)).setIconCoord(13, 5).setItemName("shears");
    146    public static Item melon = (new ItemFood(104, 2, 0.3F, false)).setIconCoord(13, 6).setItemName("melon");
    147    public static Item pumpkinSeeds = (new ItemSeeds(105, Block.pumpkinStem.blockID, Block.tilledField.blockID)).setIconCoord(13, 3).setItemName("seeds_pumpkin");
    148    public static Item melonSeeds = (new ItemSeeds(106, Block.melonStem.blockID, Block.tilledField.blockID)).setIconCoord(14, 3).setItemName("seeds_melon");
    149    public static Item beefRaw = (new ItemFood(107, 3, 0.3F, true)).setIconCoord(9, 6).setItemName("beefRaw");
    150    public static Item beefCooked = (new ItemFood(108, 8, 0.8F, true)).setIconCoord(10, 6).setItemName("beefCooked");
    151    public static Item chickenRaw = (new ItemFood(109, 2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setIconCoord(9, 7).setItemName("chickenRaw");
    152    public static Item chickenCooked = (new ItemFood(110, 6, 0.6F, true)).setIconCoord(10, 7).setItemName("chickenCooked");
    153    public static Item rottenFlesh = (new ItemFood(111, 4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setIconCoord(11, 5).setItemName("rottenFlesh");
    154    public static Item enderPearl = (new ItemEnderPearl(112)).setIconCoord(11, 6).setItemName("enderPearl");
    155    public static Item blazeRod = (new Item(113)).setIconCoord(12, 6).setItemName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials);
    156    public static Item ghastTear = (new Item(114)).setIconCoord(11, 7).setItemName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing);
    157    public static Item goldNugget = (new Item(115)).setIconCoord(12, 7).setItemName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials);
    158    public static Item netherStalkSeeds = (new ItemSeeds(116, Block.netherStalk.blockID, Block.slowSand.blockID)).setIconCoord(13, 7).setItemName("netherStalkSeeds").setPotionEffect("+4");
    159    public static ItemPotion potion = (ItemPotion)(new ItemPotion(117)).setIconCoord(13, 8).setItemName("potion");
    160    public static Item glassBottle = (new ItemGlassBottle(118)).setIconCoord(12, 8).setItemName("glassBottle");
    161    public static Item spiderEye = (new ItemFood(119, 2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setIconCoord(11, 8).setItemName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect);
    162    public static Item fermentedSpiderEye = (new Item(120)).setIconCoord(10, 8).setItemName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing);
    163    public static Item blazePowder = (new Item(121)).setIconCoord(13, 9).setItemName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing);
    164    public static Item magmaCream = (new Item(122)).setIconCoord(13, 10).setItemName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing);
    165    public static Item brewingStand = (new ItemReed(123, Block.brewingStand)).setIconCoord(12, 10).setItemName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing);
    166    public static Item cauldron = (new ItemReed(124, Block.cauldron)).setIconCoord(12, 9).setItemName("cauldron").setCreativeTab(CreativeTabs.tabBrewing);
    167    public static Item eyeOfEnder = (new ItemEnderEye(125)).setIconCoord(11, 9).setItemName("eyeOfEnder");
    168    public static Item speckledMelon = (new Item(126)).setIconCoord(9, 8).setItemName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing);
    169    public static Item monsterPlacer = (new ItemMonsterPlacer(127)).setIconCoord(9, 9).setItemName("monsterPlacer");
    170
    171    /**
    172     * Bottle o' Enchanting. Drops between 1 and 3 experience orbs when thrown.
    173     */
    174    public static Item expBottle = (new ItemExpBottle(128)).setIconCoord(11, 10).setItemName("expBottle");
    175
    176    /**
    177     * Fire Charge. When used in a dispenser it fires a fireball similiar to a Ghast's.
    178     */
    179    public static Item fireballCharge = (new ItemFireball(129)).setIconCoord(14, 2).setItemName("fireball");
    180    public static Item writableBook = (new ItemWritableBook(130)).setIconCoord(11, 11).setItemName("writingBook").setCreativeTab(CreativeTabs.tabMisc);
    181    public static Item writtenBook = (new ItemEditableBook(131)).setIconCoord(12, 11).setItemName("writtenBook");
    182    public static Item emerald = (new Item(132)).setIconCoord(10, 11).setItemName("emerald").setCreativeTab(CreativeTabs.tabMaterials);
    183    public static Item itemFrame = (new ItemHangingEntity(133, EntityItemFrame.class)).setIconCoord(14, 12).setItemName("frame");
    184    public static Item flowerPot = (new ItemReed(134, Block.flowerPot)).setIconCoord(13, 11).setItemName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations);
    185    public static Item carrot = (new ItemSeedFood(135, 4, 0.6F, Block.carrot.blockID, Block.tilledField.blockID)).setIconCoord(8, 7).setItemName("carrots");
    186    public static Item potato = (new ItemSeedFood(136, 1, 0.3F, Block.potato.blockID, Block.tilledField.blockID)).setIconCoord(7, 7).setItemName("potato");
    187    public static Item bakedPotato = (new ItemFood(137, 6, 0.6F, false)).setIconCoord(6, 7).setItemName("potatoBaked");
    188    public static Item poisonousPotato = (new ItemFood(138, 2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setIconCoord(6, 8).setItemName("potatoPoisonous");
    189    public static ItemEmptyMap emptyMap = (ItemEmptyMap)(new ItemEmptyMap(139)).setIconCoord(13, 12).setItemName("emptyMap");
    190    public static Item goldenCarrot = (new ItemFood(140, 6, 1.2F, false)).setIconCoord(6, 9).setItemName("carrotGolden").setPotionEffect(PotionHelper.field_82818_l);
    191    public static Item skull = (new ItemSkull(141)).setItemName("skull");
    192    public static Item carrotOnAStick = (new ItemCarrotOnAStick(142)).setIconCoord(6, 6).setItemName("carrotOnAStick");
    193    public static Item netherStar = (new ItemSimpleFoiled(143)).setIconCoord(9, 11).setItemName("netherStar").setCreativeTab(CreativeTabs.tabMaterials);
    194    public static Item pumpkinPie = (new ItemFood(144, 8, 0.3F, false)).setIconCoord(8, 9).setItemName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood);
    195    public static Item firework = (new ItemFirework(145)).setIconCoord(9, 12).setItemName("fireworks");
    196    public static Item fireworkCharge = (new ItemFireworkCharge(146)).setIconCoord(10, 12).setItemName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc);
    197    public static ItemEnchantedBook enchantedBook = (ItemEnchantedBook)(new ItemEnchantedBook(147)).setIconCoord(15, 12).setMaxStackSize(1).setItemName("enchantedBook");
    198    public static Item record13 = (new ItemRecord(2000, "13")).setIconCoord(0, 15).setItemName("record");
    199    public static Item recordCat = (new ItemRecord(2001, "cat")).setIconCoord(1, 15).setItemName("record");
    200    public static Item recordBlocks = (new ItemRecord(2002, "blocks")).setIconCoord(2, 15).setItemName("record");
    201    public static Item recordChirp = (new ItemRecord(2003, "chirp")).setIconCoord(3, 15).setItemName("record");
    202    public static Item recordFar = (new ItemRecord(2004, "far")).setIconCoord(4, 15).setItemName("record");
    203    public static Item recordMall = (new ItemRecord(2005, "mall")).setIconCoord(5, 15).setItemName("record");
    204    public static Item recordMellohi = (new ItemRecord(2006, "mellohi")).setIconCoord(6, 15).setItemName("record");
    205    public static Item recordStal = (new ItemRecord(2007, "stal")).setIconCoord(7, 15).setItemName("record");
    206    public static Item recordStrad = (new ItemRecord(2008, "strad")).setIconCoord(8, 15).setItemName("record");
    207    public static Item recordWard = (new ItemRecord(2009, "ward")).setIconCoord(9, 15).setItemName("record");
    208    public static Item record11 = (new ItemRecord(2010, "11")).setIconCoord(10, 15).setItemName("record");
    209    public static Item recordWait = (new ItemRecord(2011, "wait")).setIconCoord(11, 15).setItemName("record");
    210
    211    /** The ID of this item. */
    212    public final int itemID;
    213
    214    /** Maximum size of the stack. */
    215    protected int maxStackSize = 64;
    216
    217    /** Maximum damage an item can handle. */
    218    private int maxDamage = 0;
    219
    220    /** Icon index in the icons table. */
    221    protected int iconIndex;
    222
    223    /** If true, render the object in full 3D, like weapons and tools. */
    224    protected boolean bFull3D = false;
    225
    226    /**
    227     * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior
    228     */
    229    protected boolean hasSubtypes = false;
    230    private Item containerItem = null;
    231    private String potionEffect = null;
    232
    233    /** full name of item from language file */
    234    private String itemName;
    235
    236    /** FORGE: To disable repair recipes. */
    237    protected boolean canRepair = true;
    238
    239    public Item(int par1)
    240    {
    241        this.itemID = 256 + par1;
    242
    243        if (itemsList[256 + par1] != null)
    244        {
    245            System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this);
    246        }
    247
    248        itemsList[256 + par1] = this;
    249
    250        GameData.newItemAdded(this);
    251
    252        if (!(this instanceof ItemBlock))
    253        {
    254            isDefaultTexture = "/gui/items.png".equals(getTextureFile());
    255        }
    256    }
    257
    258    /**
    259     * Sets the icon index for this item. Returns the item.
    260     */
    261    public Item setIconIndex(int par1)
    262    {
    263        this.iconIndex = par1;
    264        return this;
    265    }
    266
    267    public Item setMaxStackSize(int par1)
    268    {
    269        this.maxStackSize = par1;
    270        return this;
    271    }
    272
    273    public Item setIconCoord(int par1, int par2)
    274    {
    275        this.iconIndex = par1 + par2 * 16;
    276        return this;
    277    }
    278
    279    @SideOnly(Side.CLIENT)
    280
    281    /**
    282     * Gets an icon index based on an item's damage value
    283     */
    284    public int getIconFromDamage(int par1)
    285    {
    286        return this.iconIndex;
    287    }
    288
    289    @SideOnly(Side.CLIENT)
    290
    291    /**
    292     * Returns the icon index of the stack given as argument.
    293     */
    294    public final int getIconIndex(ItemStack par1ItemStack)
    295    {
    296        return this.getIconFromDamage(par1ItemStack.getItemDamage());
    297    }
    298
    299    /**
    300     * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
    301     * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
    302     */
    303    public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    304    {
    305        return false;
    306    }
    307
    308    /**
    309     * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
    310     * sword
    311     */
    312    public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    313    {
    314        return 1.0F;
    315    }
    316
    317    /**
    318     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
    319     */
    320    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    321    {
    322        return par1ItemStack;
    323    }
    324
    325    public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    326    {
    327        return par1ItemStack;
    328    }
    329
    330    /**
    331     * Returns the maximum size of the stack for a specific item. *Isn't this more a Set than a Get?*
    332     */
    333    public int getItemStackLimit()
    334    {
    335        return this.maxStackSize;
    336    }
    337
    338    /**
    339     * Returns the metadata of the block which this Item (ItemBlock) can place
    340     */
    341    public int getMetadata(int par1)
    342    {
    343        return 0;
    344    }
    345
    346    public boolean getHasSubtypes()
    347    {
    348        return this.hasSubtypes;
    349    }
    350
    351    protected Item setHasSubtypes(boolean par1)
    352    {
    353        this.hasSubtypes = par1;
    354        return this;
    355    }
    356
    357    /**
    358     * Returns the maximum damage an item can take.
    359     */
    360    public int getMaxDamage()
    361    {
    362        return this.maxDamage;
    363    }
    364
    365    /**
    366     * set max damage of an Item
    367     */
    368    public Item setMaxDamage(int par1)
    369    {
    370        this.maxDamage = par1;
    371        return this;
    372    }
    373
    374    public boolean isDamageable()
    375    {
    376        return this.maxDamage > 0 && !this.hasSubtypes;
    377    }
    378
    379    /**
    380     * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
    381     * the damage on the stack.
    382     */
    383    public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    384    {
    385        return false;
    386    }
    387
    388    public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
    389    {
    390        return false;
    391    }
    392
    393    /**
    394     * Returns the damage against a given entity.
    395     */
    396    public int getDamageVsEntity(Entity par1Entity)
    397    {
    398        return 1;
    399    }
    400
    401    /**
    402     * Returns if the item (tool) can harvest results from the block type.
    403     */
    404    public boolean canHarvestBlock(Block par1Block)
    405    {
    406        return false;
    407    }
    408
    409    /**
    410     * Called when a player right clicks an entity with an item.
    411     */
    412    public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving)
    413    {
    414        return false;
    415    }
    416
    417    /**
    418     * Sets bFull3D to True and return the object.
    419     */
    420    public Item setFull3D()
    421    {
    422        this.bFull3D = true;
    423        return this;
    424    }
    425
    426    @SideOnly(Side.CLIENT)
    427
    428    /**
    429     * Returns True is the item is renderer in full 3D when hold.
    430     */
    431    public boolean isFull3D()
    432    {
    433        return this.bFull3D;
    434    }
    435
    436    @SideOnly(Side.CLIENT)
    437
    438    /**
    439     * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
    440     * hands.
    441     */
    442    public boolean shouldRotateAroundWhenRendering()
    443    {
    444        return false;
    445    }
    446
    447    /**
    448     * set name of item from language file
    449     */
    450    public Item setItemName(String par1Str)
    451    {
    452        this.itemName = "item." + par1Str;
    453        return this;
    454    }
    455
    456    public String getLocalItemName(ItemStack par1ItemStack)
    457    {
    458        String var2 = this.getItemNameIS(par1ItemStack);
    459        return var2 == null ? "" : StatCollector.translateToLocal(var2);
    460    }
    461
    462    public String getItemName()
    463    {
    464        return this.itemName;
    465    }
    466
    467    public String getItemNameIS(ItemStack par1ItemStack)
    468    {
    469        return this.itemName;
    470    }
    471
    472    public Item setContainerItem(Item par1Item)
    473    {
    474        this.containerItem = par1Item;
    475        return this;
    476    }
    477
    478    /**
    479     * If this returns true, after a recipe involving this item is crafted the container item will be added to the
    480     * player's inventory instead of remaining in the crafting grid.
    481     */
    482    public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
    483    {
    484        return true;
    485    }
    486
    487    /**
    488     * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
    489     */
    490    public boolean getShareTag()
    491    {
    492        return true;
    493    }
    494
    495    public Item getContainerItem()
    496    {
    497        return this.containerItem;
    498    }
    499
    500    /**
    501     * True if this Item has a container item (a.k.a. crafting result)
    502     */
    503    public boolean hasContainerItem()
    504    {
    505        return this.containerItem != null;
    506    }
    507
    508    public String getStatName()
    509    {
    510        return StatCollector.translateToLocal(this.getItemName() + ".name");
    511    }
    512
    513    public String func_77653_i(ItemStack par1ItemStack)
    514    {
    515        return StatCollector.translateToLocal(this.getItemNameIS(par1ItemStack) + ".name");
    516    }
    517
    518    @SideOnly(Side.CLIENT)
    519    public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
    520    {
    521        return 16777215;
    522    }
    523
    524    /**
    525     * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
    526     * update it's contents.
    527     */
    528    public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {}
    529
    530    /**
    531     * Called when item is crafted/smelted. Used only by maps so far.
    532     */
    533    public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {}
    534
    535    /**
    536     * false for all Items except sub-classes of ItemMapBase
    537     */
    538    public boolean isMap()
    539    {
    540        return false;
    541    }
    542
    543    /**
    544     * returns the action that specifies what animation to play when the items is being used
    545     */
    546    public EnumAction getItemUseAction(ItemStack par1ItemStack)
    547    {
    548        return EnumAction.none;
    549    }
    550
    551    /**
    552     * How long it takes to use or consume an item
    553     */
    554    public int getMaxItemUseDuration(ItemStack par1ItemStack)
    555    {
    556        return 0;
    557    }
    558
    559    /**
    560     * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
    561     */
    562    public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {}
    563
    564    /**
    565     * Sets the string representing this item's effect on a potion when used as an ingredient.
    566     */
    567    protected Item setPotionEffect(String par1Str)
    568    {
    569        this.potionEffect = par1Str;
    570        return this;
    571    }
    572
    573    /**
    574     * Returns a string representing what this item does to a potion.
    575     * @Deprecated In favor of ItemStack sensitive version
    576     */
    577    public String getPotionEffect()
    578    {
    579        return this.potionEffect;
    580    }
    581
    582    /**
    583     * Returns true if this item serves as a potion ingredient (its ingredient information is not null).
    584     * @Deprecated In favor of ItemStack sensitive version
    585     */
    586    public boolean isPotionIngredient()
    587    {
    588        return this.potionEffect != null;
    589    }
    590
    591    @SideOnly(Side.CLIENT)
    592
    593    /**
    594     * allows items to add custom lines of information to the mouseover description
    595     */
    596    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {}
    597
    598    public String getItemDisplayName(ItemStack par1ItemStack)
    599    {
    600        return ("" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
    601    }
    602
    603    @SideOnly(Side.CLIENT)
    604    public boolean hasEffect(ItemStack par1ItemStack)
    605    {
    606        return par1ItemStack.isItemEnchanted();
    607    }
    608
    609    @SideOnly(Side.CLIENT)
    610
    611    /**
    612     * Return an item rarity from EnumRarity
    613     */
    614    public EnumRarity getRarity(ItemStack par1ItemStack)
    615    {
    616        return par1ItemStack.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common;
    617    }
    618
    619    /**
    620     * Checks isDamagable and if it cannot be stacked
    621     */
    622    public boolean isItemTool(ItemStack par1ItemStack)
    623    {
    624        return this.getItemStackLimit() == 1 && this.isDamageable();
    625    }
    626
    627    protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
    628    {
    629        float var4 = 1.0F;
    630        float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
    631        float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
    632        double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
    633        double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
    634        double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
    635        Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
    636        float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
    637        float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
    638        float var16 = -MathHelper.cos(-var5 * 0.017453292F);
    639        float var17 = MathHelper.sin(-var5 * 0.017453292F);
    640        float var18 = var15 * var16;
    641        float var20 = var14 * var16;
    642        double var21 = 5.0D;
    643        if (par2EntityPlayer instanceof EntityPlayerMP)
    644        {
    645            var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
    646        }
    647        Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
    648        return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
    649    }
    650
    651    /**
    652     * Return the enchantability factor of the item, most of the time is based on material.
    653     */
    654    public int getItemEnchantability()
    655    {
    656        return 0;
    657    }
    658
    659    @SideOnly(Side.CLIENT)
    660    public boolean requiresMultipleRenderPasses()
    661    {
    662        return false;
    663    }
    664
    665    @SideOnly(Side.CLIENT)
    666
    667    /**
    668     * Gets an icon index based on an item's damage value and the given render pass
    669     */
    670    public int getIconFromDamageForRenderPass(int par1, int par2)
    671    {
    672        return this.getIconFromDamage(par1);
    673    }
    674
    675    @SideOnly(Side.CLIENT)
    676
    677    /**
    678     * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
    679     */
    680    public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
    681    {
    682        par3List.add(new ItemStack(par1, 1, 0));
    683    }
    684
    685    /**
    686     * returns this;
    687     */
    688    public Item setCreativeTab(CreativeTabs par1CreativeTabs)
    689    {
    690        this.tabToDisplayOn = par1CreativeTabs;
    691        return this;
    692    }
    693
    694    @SideOnly(Side.CLIENT)
    695
    696    /**
    697     * gets the CreativeTab this item is displayed on
    698     */
    699    public CreativeTabs getCreativeTab()
    700    {
    701        return this.tabToDisplayOn;
    702    }
    703
    704    public boolean func_82788_x()
    705    {
    706        return true;
    707    }
    708
    709    /**
    710     * Return whether this item is repairable in an anvil.
    711     */
    712    public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
    713    {
    714        return false;
    715    }
    716
    717    static
    718    {
    719        StatList.initStats();
    720    }
    721
    722    /* =========================================================== FORGE START ===============================================================*/
    723    public boolean isDefaultTexture = true;
    724    private String currentTexture = "/gui/items.png";
    725
    726    /**
    727     * Called when a player drops the item into the world,
    728     * returning false from this will prevent the item from
    729     * being removed from the players inventory and spawning
    730     * in the world
    731     *
    732     * @param player The player that dropped the item
    733     * @param item The item stack, before the item is removed.
    734     */
    735    public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
    736    {
    737        return true;
    738    }
    739
    740    /**
    741     * This is called when the item is used, before the block is activated.
    742     * @param stack The Item Stack
    743     * @param player The Player that used the item
    744     * @param world The Current World
    745     * @param x Target X Position
    746     * @param y Target Y Position
    747     * @param z Target Z Position
    748     * @param side The side of the target hit
    749     * @return Return true to prevent any further processing.
    750     */
    751    public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
    752    {
    753        return false;
    754    }
    755
    756    /**
    757     * Metadata-sensitive version of getStrVsBlock
    758     * @param itemstack The Item Stack
    759     * @param block The block the item is trying to break
    760     * @param metadata The items current metadata
    761     * @return The damage strength
    762     */
    763    public float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
    764    {
    765        return getStrVsBlock(itemstack, block);
    766    }
    767
    768    /**
    769     * Called by CraftingManager to determine if an item is reparable.
    770     * @return True if reparable
    771     */
    772    public boolean isRepairable()
    773    {
    774        return canRepair && isDamageable();
    775    }
    776
    777    /**
    778     * Call to disable repair recipes.
    779     * @return The current Item instance
    780     */
    781    public Item setNoRepair()
    782    {
    783        canRepair = false;
    784        return this;
    785    }
    786
    787    /**
    788     * Called before a block is broken.  Return true to prevent default block harvesting.
    789     *
    790     * Note: In SMP, this is called on both client and server sides!
    791     *
    792     * @param itemstack The current ItemStack
    793     * @param X The X Position
    794     * @param Y The X Position
    795     * @param Z The X Position
    796     * @param player The Player that is wielding the item
    797     * @return True to prevent harvesting, false to continue as normal
    798     */
    799    public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
    800    {
    801        return false;
    802    }
    803
    804    /**
    805     * Called each tick while using an item.
    806     * @param stack The Item being used
    807     * @param player The Player using the item
    808     * @param count The amount of time in tick the item has been used for continuously
    809     */
    810    public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
    811    {
    812    }
    813
    814    /**
    815     * Called when the player Left Clicks (attacks) an entity.
    816     * Processed before damage is done, if return value is true further processing is canceled
    817     * and the entity is not attacked.
    818     *
    819     * @param stack The Item being used
    820     * @param player The player that is attacking
    821     * @param entity The entity being attacked
    822     * @return True to cancel the rest of the interaction.
    823     */
    824    public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
    825    {
    826        return false;
    827    }
    828
    829    /**
    830     * Player, Render pass, and item usage sensitive version of getIconIndex.
    831     *
    832     * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null)
    833     * @param renderPass The pass to get the icon for, 0 is default.
    834     * @param player The player holding the item
    835     * @param usingItem The item the player is actively using. Can be null if not using anything.
    836     * @param useRemaining The ticks remaining for the active item.
    837     * @return The icon index
    838     */
    839    public int getIconIndex(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
    840    {
    841        /*
    842         * Here is an example usage for Vanilla bows.
    843        if (usingItem != null && usingItem.getItem().shiftedIndex == Item.bow.shiftedIndex)
    844        {
    845            int k = usingItem.getMaxItemUseDuration() - useRemaining;
    846            if (k >= 18) return 133;
    847            if (k >  13) return 117;
    848            if (k >   0) return 101;
    849        }
    850         */
    851        return getIconIndex(stack);
    852    }
    853
    854    /**
    855     * Returns the number of render passes/layers this item has.
    856     * Usually equates to ItemRenderer.renderItem being called for this many passes.
    857     * Does not get called unless requiresMultipleRenderPasses() is true;
    858     *
    859     * @param metadata The item's metadata
    860     * @return The number of passes to run.
    861     */
    862    public int getRenderPasses(int metadata)
    863    {
    864        return requiresMultipleRenderPasses() ? 2 : 1;
    865    }
    866
    867    /**
    868     * Grabs the current texture file used for this block
    869     */
    870    public String getTextureFile()
    871    {
    872        if (this instanceof ItemBlock)
    873        {
    874            return Block.blocksList[((ItemBlock)this).getBlockID()].getTextureFile();
    875        }
    876        return currentTexture;
    877    }
    878
    879    /**
    880     * Sets the current texture file for this item, used when rendering.
    881     * Default is "/gui/items.png"
    882     *
    883     * @param texture The texture file
    884     */
    885    public Item setTextureFile(String texture)
    886    {
    887        currentTexture = texture;
    888        isDefaultTexture = false;
    889        return this;
    890    }
    891
    892    /**
    893     * ItemStack sensitive version of getContainerItem.
    894     * Returns a full ItemStack instance of the result.
    895     *
    896     * @param itemStack The current ItemStack
    897     * @return The resulting ItemStack
    898     */
    899    public ItemStack getContainerItemStack(ItemStack itemStack)
    900    {
    901        if (!hasContainerItem())
    902        {
    903            return null;
    904        }
    905        return new ItemStack(getContainerItem());
    906    }
    907
    908    /**
    909     * Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem.
    910     * This is in ticks, standard result is 6000, or 5 mins.
    911     *
    912     * @param itemStack The current ItemStack
    913     * @param world The world the entity is in
    914     * @return The normal lifespan in ticks.
    915     */
    916    public int getEntityLifespan(ItemStack itemStack, World world)
    917    {
    918        return 6000;
    919    }
    920
    921    /**
    922     * Determines if this Item has a special entity for when they are in the world.
    923     * Is called when a EntityItem is spawned in the world, if true and Item#createCustomEntity
    924     * returns non null, the EntityItem will be destroyed and the new Entity will be added to the world.
    925     *
    926     * @param stack The current item stack
    927     * @return True of the item has a custom entity, If true, Item#createCustomEntity will be called
    928     */
    929    public boolean hasCustomEntity(ItemStack stack)
    930    {
    931        return false;
    932    }
    933
    934    /**
    935     * This function should return a new entity to replace the dropped item.
    936     * Returning null here will not kill the EntityItem and will leave it to function normally.
    937     * Called when the item it placed in a world.
    938     *
    939     * @param world The world object
    940     * @param location The EntityItem object, useful for getting the position of the entity
    941     * @param itemstack The current item stack
    942     * @return A new Entity object to spawn or null
    943     */
    944    public Entity createEntity(World world, Entity location, ItemStack itemstack)
    945    {
    946        return null;
    947    }
    948
    949    /**
    950     * Gets a list of tabs that items belonging to this class can display on,
    951     * combined properly with getSubItems allows for a single item to span
    952     * many sub-items across many tabs.
    953     *
    954     * @return A list of all tabs that this item could possibly be one.
    955     */
    956    public CreativeTabs[] getCreativeTabs()
    957    {
    958        return new CreativeTabs[]{ getCreativeTab() };
    959    }
    960
    961    /**
    962     * Determines the base experience for a player when they remove this item from a furnace slot.
    963     * This number must be between 0 and 1 for it to be valid.
    964     * This number will be multiplied by the stack size to get the total experience.
    965     *
    966     * @param item The item stack the player is picking up.
    967     * @return The amount to award for each item.
    968     */
    969    public float getSmeltingExperience(ItemStack item)
    970    {
    971        return -1; //-1 will default to the old lookups.
    972    }
    973
    974    /**
    975     * Return the correct icon for rendering based on the supplied ItemStack and render pass.
    976     *
    977     * Defers to {@link #getIconFromDamageForRenderPass(int, int)}
    978     * @param stack to render for
    979     * @param pass the multi-render pass
    980     * @return the icon index
    981     */
    982    public int getIconIndex(ItemStack stack, int pass)
    983    {
    984        return getIconFromDamageForRenderPass(stack.getItemDamage(), pass);
    985    }
    986
    987    /**
    988     * Generates the base Random item for a specific instance of the chest gen,
    989     * Enchanted books use this to pick a random enchantment.
    990     *
    991     * @param chest The chest category to generate for
    992     * @param rnd World RNG
    993     * @param original Original result registered with the chest gen hooks.
    994     * @return New values to use as the random item, typically this will be original
    995     */
    996    public WeightedRandomChestContent getChestGenBase(ChestGenHooks chest, Random rnd, WeightedRandomChestContent original)
    997    {
    998        if (this instanceof ItemEnchantedBook)
    999        {
    1000            return ((ItemEnchantedBook)this).func_92112_a(rnd,
    1001                    original.theMinimumChanceToGenerateItem,
    1002                    original.theMaximumChanceToGenerateItem, original.itemWeight);
    1003        }
    1004        return original;
    1005    }
    1006
    1007    /**
    1008     *
    1009     * Should this item, when held, allow sneak-clicks to pass through to the underlying block?
    1010     *
    1011     * @param par2World
    1012     * @param par4
    1013     * @param par5
    1014     * @param par6
    1015     * @return
    1016     */
    1017    public boolean shouldPassSneakingClickToBlock(World par2World, int par4, int par5, int par6)
    1018    {
    1019        return false;
    1020    }
    1021
    1022
    1023    /**
    1024     * Called to tick armor in the armor slot. Override to do something
    1025     *
    1026     * @param world
    1027     * @param player
    1028     * @param itemStack
    1029     */
    1030    public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack)
    1031    {
    1032
    1033    }
    1034
    1035    /**
    1036     * Determines if the specific ItemStack can be placed in the specified armor slot.
    1037     *
    1038     * @param stack The ItemStack
    1039     * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots
    1040     * @return True if the given ItemStack can be inserted in the slot
    1041     */
    1042    public boolean isValidArmor(ItemStack stack, int armorType)
    1043    {
    1044        if (this instanceof ItemArmor)
    1045        {
    1046            return ((ItemArmor)this).armorType == armorType;
    1047        }
    1048
    1049        if (armorType == 0)
    1050        {
    1051            return itemID == Block.pumpkin.blockID || itemID == Item.skull.itemID;
    1052        }
    1053
    1054        return false;
    1055    }
    1056
    1057    /**
    1058     * ItemStack sensitive version of isPotionIngredient
    1059     *
    1060     * @param stack The item stack
    1061     * @return True if this stack can be used as a potion ingredient
    1062     */
    1063    public boolean isPotionIngredient(ItemStack stack)
    1064    {
    1065        return isPotionIngredient();
    1066    }
    1067
    1068    /**
    1069     * ItemStack sensitive version of getPotionEffect
    1070     *
    1071     * @param stack The item stack
    1072     * @return A string containing the bit manipulation to apply the the potion.
    1073     */
    1074    public String getPotionEffect(ItemStack stack)
    1075    {
    1076        return getPotionEffect();
    1077    }
    1078
    1079}