SHARE
TWEET

Untitled

a guest Feb 20th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.minecraft.item;
  2.  
  3. import com.google.common.collect.HashMultimap;
  4. import com.google.common.collect.Multimap;
  5. import com.google.common.collect.Sets;
  6. import java.util.HashSet;
  7. import java.util.Iterator;
  8. import java.util.List;
  9. import java.util.Random;
  10. import java.util.UUID;
  11. import net.minecraft.block.Block;
  12. import net.minecraft.block.BlockDirt;
  13. import net.minecraft.block.BlockDoublePlant;
  14. import net.minecraft.block.BlockFlower;
  15. import net.minecraft.block.BlockNewLog;
  16. import net.minecraft.block.BlockOldLog;
  17. import net.minecraft.block.BlockQuartz;
  18. import net.minecraft.block.BlockSand;
  19. import net.minecraft.block.BlockSandStone;
  20. import net.minecraft.block.BlockSapling;
  21. import net.minecraft.block.BlockSilverfish;
  22. import net.minecraft.block.BlockStoneBrick;
  23. import net.minecraft.block.BlockWall;
  24. import net.minecraft.block.BlockWood;
  25. import net.minecraft.block.material.Material;
  26. import net.minecraft.client.renderer.texture.IIconRegister;
  27. import net.minecraft.creativetab.CreativeTabs;
  28. import net.minecraft.entity.Entity;
  29. import net.minecraft.entity.EntityLivingBase;
  30. import net.minecraft.entity.item.EntityItemFrame;
  31. import net.minecraft.entity.item.EntityPainting;
  32. import net.minecraft.entity.player.EntityPlayer;
  33. import net.minecraft.init.Blocks;
  34. import net.minecraft.init.Items;
  35. import net.minecraft.potion.Potion;
  36. import net.minecraft.potion.PotionHelper;
  37. import net.minecraft.util.IIcon;
  38. import net.minecraft.util.MathHelper;
  39. import net.minecraft.util.MovingObjectPosition;
  40. import net.minecraft.util.RegistryNamespaced;
  41. import net.minecraft.util.StatCollector;
  42. import net.minecraft.util.Vec3;
  43. import net.minecraft.world.World;
  44.  
  45. public class Item
  46. {
  47.     public static final RegistryNamespaced itemRegistry = new RegistryNamespaced();
  48.     protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
  49.     private CreativeTabs tabToDisplayOn;
  50.  
  51.     /** The RNG used by the Item subclasses. */
  52.     protected static Random itemRand = new Random();
  53.  
  54.     /** Maximum size of the stack. */
  55.     protected int maxStackSize = 64;
  56.  
  57.     /** Maximum damage an item can handle. */
  58.     private int maxDamage;
  59.  
  60.     /** If true, render the object in full 3D, like weapons and tools. */
  61.     protected boolean bFull3D;
  62.  
  63.     /**
  64.      * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior
  65.      */
  66.     protected boolean hasSubtypes;
  67.     private Item containerItem;
  68.     private String potionEffect;
  69.  
  70.     /** The unlocalized name of this item. */
  71.     private String unlocalizedName;
  72.  
  73.     /** Icon index in the icons table. */
  74.     protected IIcon itemIcon;
  75.  
  76.     /** The string associated with this Item's Icon. */
  77.     protected String iconString;
  78.     private static final String __OBFID = "CL_00000041";
  79.  
  80.     public static int getIdFromItem(Item p_150891_0_)
  81.     {
  82.         return p_150891_0_ == null ? 0 : itemRegistry.getIDForObject(p_150891_0_);
  83.     }
  84.  
  85.     public static Item getItemById(int p_150899_0_)
  86.     {
  87.         return (Item)itemRegistry.getObjectForID(p_150899_0_);
  88.     }
  89.  
  90.     public static Item getItemFromBlock(Block p_150898_0_)
  91.     {
  92.         return getItemById(Block.getIdFromBlock(p_150898_0_));
  93.     }
  94.  
  95.     public static void registerItems()
  96.     {
  97.         itemRegistry.addObject(256, "iron_shovel", (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron").setTextureName("iron_shovel"));
  98.         itemRegistry.addObject(257, "iron_pickaxe", (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron").setTextureName("iron_pickaxe"));
  99.         itemRegistry.addObject(258, "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron").setTextureName("iron_axe"));
  100.         itemRegistry.addObject(259, "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel").setTextureName("flint_and_steel"));
  101.         itemRegistry.addObject(260, "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple").setTextureName("apple"));
  102.         itemRegistry.addObject(261, "bow", (new ItemBow()).setUnlocalizedName("bow").setTextureName("bow"));
  103.         itemRegistry.addObject(262, "arrow", (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat).setTextureName("arrow"));
  104.         itemRegistry.addObject(263, "coal", (new ItemCoal()).setUnlocalizedName("coal").setTextureName("coal"));
  105.         itemRegistry.addObject(264, "diamond", (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("diamond"));
  106.         itemRegistry.addObject(265, "iron_ingot", (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("iron_ingot"));
  107.         itemRegistry.addObject(266, "gold_ingot", (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_ingot"));
  108.         itemRegistry.addObject(267, "iron_sword", (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron").setTextureName("iron_sword"));
  109.         itemRegistry.addObject(268, "wooden_sword", (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood").setTextureName("wood_sword"));
  110.         itemRegistry.addObject(269, "wooden_shovel", (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood").setTextureName("wood_shovel"));
  111.         itemRegistry.addObject(270, "wooden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood").setTextureName("wood_pickaxe"));
  112.         itemRegistry.addObject(271, "wooden_axe", (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood").setTextureName("wood_axe"));
  113.         itemRegistry.addObject(272, "stone_sword", (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone").setTextureName("stone_sword"));
  114.         itemRegistry.addObject(273, "stone_shovel", (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone").setTextureName("stone_shovel"));
  115.         itemRegistry.addObject(274, "stone_pickaxe", (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone").setTextureName("stone_pickaxe"));
  116.         itemRegistry.addObject(275, "stone_axe", (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone").setTextureName("stone_axe"));
  117.         itemRegistry.addObject(276, "diamond_sword", (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond").setTextureName("diamond_sword"));
  118.         itemRegistry.addObject(277, "diamond_shovel", (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond").setTextureName("diamond_shovel"));
  119.         itemRegistry.addObject(278, "diamond_pickaxe", (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond").setTextureName("diamond_pickaxe"));
  120.         itemRegistry.addObject(279, "diamond_axe", (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond").setTextureName("diamond_axe"));
  121.         itemRegistry.addObject(280, "stick", (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("stick"));
  122.         itemRegistry.addObject(281, "bowl", (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("bowl"));
  123.         itemRegistry.addObject(282, "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew").setTextureName("mushroom_stew"));
  124.         itemRegistry.addObject(283, "golden_sword", (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold").setTextureName("gold_sword"));
  125.         itemRegistry.addObject(284, "golden_shovel", (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold").setTextureName("gold_shovel"));
  126.         itemRegistry.addObject(285, "golden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold").setTextureName("gold_pickaxe"));
  127.         itemRegistry.addObject(286, "golden_axe", (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold").setTextureName("gold_axe"));
  128.         itemRegistry.addObject(287, "string", (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("string"));
  129.         itemRegistry.addObject(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather"));
  130.         itemRegistry.addObject(289, "gunpowder", (new Item()).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder"));
  131.         itemRegistry.addObject(290, "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood").setTextureName("wood_hoe"));
  132.         itemRegistry.addObject(291, "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone").setTextureName("stone_hoe"));
  133.         itemRegistry.addObject(292, "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron").setTextureName("iron_hoe"));
  134.         itemRegistry.addObject(293, "diamond_hoe", (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond").setTextureName("diamond_hoe"));
  135.         itemRegistry.addObject(294, "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold").setTextureName("gold_hoe"));
  136.         itemRegistry.addObject(295, "wheat_seeds", (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds").setTextureName("seeds_wheat"));
  137.         itemRegistry.addObject(296, "wheat", (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("wheat"));
  138.         itemRegistry.addObject(297, "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread").setTextureName("bread"));
  139.         itemRegistry.addObject(298, "leather_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 0)).setUnlocalizedName("helmetCloth").setTextureName("leather_helmet"));
  140.         itemRegistry.addObject(299, "leather_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 1)).setUnlocalizedName("chestplateCloth").setTextureName("leather_chestplate"));
  141.         itemRegistry.addObject(300, "leather_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 2)).setUnlocalizedName("leggingsCloth").setTextureName("leather_leggings"));
  142.         itemRegistry.addObject(301, "leather_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 3)).setUnlocalizedName("bootsCloth").setTextureName("leather_boots"));
  143.         itemRegistry.addObject(302, "chainmail_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain").setTextureName("chainmail_helmet"));
  144.         itemRegistry.addObject(303, "chainmail_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain").setTextureName("chainmail_chestplate"));
  145.         itemRegistry.addObject(304, "chainmail_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain").setTextureName("chainmail_leggings"));
  146.         itemRegistry.addObject(305, "chainmail_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain").setTextureName("chainmail_boots"));
  147.         itemRegistry.addObject(306, "iron_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron").setTextureName("iron_helmet"));
  148.         itemRegistry.addObject(307, "iron_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron").setTextureName("iron_chestplate"));
  149.         itemRegistry.addObject(308, "iron_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron").setTextureName("iron_leggings"));
  150.         itemRegistry.addObject(309, "iron_boots", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron").setTextureName("iron_boots"));
  151.         itemRegistry.addObject(310, "diamond_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond").setTextureName("diamond_helmet"));
  152.         itemRegistry.addObject(311, "diamond_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond").setTextureName("diamond_chestplate"));
  153.         itemRegistry.addObject(312, "diamond_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond").setTextureName("diamond_leggings"));
  154.         itemRegistry.addObject(313, "diamond_boots", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond").setTextureName("diamond_boots"));
  155.         itemRegistry.addObject(314, "golden_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold").setTextureName("gold_helmet"));
  156.         itemRegistry.addObject(315, "golden_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold").setTextureName("gold_chestplate"));
  157.         itemRegistry.addObject(316, "golden_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold").setTextureName("gold_leggings"));
  158.         itemRegistry.addObject(317, "golden_boots", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold").setTextureName("gold_boots"));
  159.         itemRegistry.addObject(318, "flint", (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint"));
  160.         itemRegistry.addObject(319, "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw").setTextureName("porkchop_raw"));
  161.         itemRegistry.addObject(320, "cooked_porkchop", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked").setTextureName("porkchop_cooked"));
  162.         itemRegistry.addObject(321, "painting", (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting").setTextureName("painting"));
  163.         itemRegistry.addObject(322, "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold").setTextureName("apple_golden"));
  164.         itemRegistry.addObject(323, "sign", (new ItemSign()).setUnlocalizedName("sign").setTextureName("sign"));
  165.         itemRegistry.addObject(324, "wooden_door", (new ItemDoor(Material.wood)).setUnlocalizedName("doorWood").setTextureName("door_wood"));
  166.         Item var0 = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16).setTextureName("bucket_empty");
  167.         itemRegistry.addObject(325, "bucket", var0);
  168.         itemRegistry.addObject(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(var0).setTextureName("bucket_water"));
  169.         itemRegistry.addObject(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(var0).setTextureName("bucket_lava"));
  170.         itemRegistry.addObject(328, "minecart", (new ItemMinecart(0)).setUnlocalizedName("minecart").setTextureName("minecart_normal"));
  171.         itemRegistry.addObject(329, "saddle", (new ItemSaddle()).setUnlocalizedName("saddle").setTextureName("saddle"));
  172.         itemRegistry.addObject(330, "iron_door", (new ItemDoor(Material.iron)).setUnlocalizedName("doorIron").setTextureName("door_iron"));
  173.         itemRegistry.addObject(331, "redstone", (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect).setTextureName("redstone_dust"));
  174.         itemRegistry.addObject(332, "snowball", (new ItemSnowball()).setUnlocalizedName("snowball").setTextureName("snowball"));
  175.         itemRegistry.addObject(333, "boat", (new ItemBoat()).setUnlocalizedName("boat").setTextureName("boat"));
  176.         itemRegistry.addObject(334, "leather", (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("leather"));
  177.         itemRegistry.addObject(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(var0).setTextureName("bucket_milk"));
  178.         itemRegistry.addObject(336, "brick", (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("brick"));
  179.         itemRegistry.addObject(337, "clay_ball", (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("clay_ball"));
  180.         itemRegistry.addObject(338, "reeds", (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("reeds"));
  181.         itemRegistry.addObject(339, "paper", (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc).setTextureName("paper"));
  182.         itemRegistry.addObject(340, "book", (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_normal"));
  183.         itemRegistry.addObject(341, "slime_ball", (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc).setTextureName("slimeball"));
  184.         itemRegistry.addObject(342, "chest_minecart", (new ItemMinecart(1)).setUnlocalizedName("minecartChest").setTextureName("minecart_chest"));
  185.         itemRegistry.addObject(343, "furnace_minecart", (new ItemMinecart(2)).setUnlocalizedName("minecartFurnace").setTextureName("minecart_furnace"));
  186.         itemRegistry.addObject(344, "egg", (new ItemEgg()).setUnlocalizedName("egg").setTextureName("egg"));
  187.         itemRegistry.addObject(345, "compass", (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools).setTextureName("compass"));
  188.         itemRegistry.addObject(346, "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod").setTextureName("fishing_rod"));
  189.         itemRegistry.addObject(347, "clock", (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools).setTextureName("clock"));
  190.         itemRegistry.addObject(348, "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust"));
  191.         itemRegistry.addObject(349, "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setTextureName("fish_raw").setHasSubtypes(true));
  192.         itemRegistry.addObject(350, "cooked_fished", (new ItemFishFood(true)).setUnlocalizedName("fish").setTextureName("fish_cooked").setHasSubtypes(true));
  193.         itemRegistry.addObject(351, "dye", (new ItemDye()).setUnlocalizedName("dyePowder").setTextureName("dye_powder"));
  194.         itemRegistry.addObject(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone"));
  195.         itemRegistry.addObject(353, "sugar", (new Item()).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar"));
  196.         itemRegistry.addObject(354, "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood).setTextureName("cake"));
  197.         itemRegistry.addObject(355, "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed").setTextureName("bed"));
  198.         itemRegistry.addObject(356, "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("repeater"));
  199.         itemRegistry.addObject(357, "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie").setTextureName("cookie"));
  200.         itemRegistry.addObject(358, "filled_map", (new ItemMap()).setUnlocalizedName("map").setTextureName("map_filled"));
  201.         itemRegistry.addObject(359, "shears", (new ItemShears()).setUnlocalizedName("shears").setTextureName("shears"));
  202.         itemRegistry.addObject(360, "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon").setTextureName("melon"));
  203.         itemRegistry.addObject(361, "pumpkin_seeds", (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin").setTextureName("seeds_pumpkin"));
  204.         itemRegistry.addObject(362, "melon_seeds", (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon").setTextureName("seeds_melon"));
  205.         itemRegistry.addObject(363, "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw").setTextureName("beef_raw"));
  206.         itemRegistry.addObject(364, "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked").setTextureName("beef_cooked"));
  207.         itemRegistry.addObject(365, "chicken", (new ItemFood(2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw").setTextureName("chicken_raw"));
  208.         itemRegistry.addObject(366, "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked").setTextureName("chicken_cooked"));
  209.         itemRegistry.addObject(367, "rotten_flesh", (new ItemFood(4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh").setTextureName("rotten_flesh"));
  210.         itemRegistry.addObject(368, "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl").setTextureName("ender_pearl"));
  211.         itemRegistry.addObject(369, "blaze_rod", (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("blaze_rod"));
  212.         itemRegistry.addObject(370, "ghast_tear", (new Item()).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear"));
  213.         itemRegistry.addObject(371, "gold_nugget", (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_nugget"));
  214.         itemRegistry.addObject(372, "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4").setTextureName("nether_wart"));
  215.         itemRegistry.addObject(373, "potion", (new ItemPotion()).setUnlocalizedName("potion").setTextureName("potion"));
  216.         itemRegistry.addObject(374, "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle").setTextureName("potion_bottle_empty"));
  217.         itemRegistry.addObject(375, "spider_eye", (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect).setTextureName("spider_eye"));
  218.         itemRegistry.addObject(376, "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented"));
  219.         itemRegistry.addObject(377, "blaze_powder", (new Item()).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder"));
  220.         itemRegistry.addObject(378, "magma_cream", (new Item()).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream"));
  221.         itemRegistry.addObject(379, "brewing_stand", (new ItemReed(Blocks.brewing_stand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("brewing_stand"));
  222.         itemRegistry.addObject(380, "cauldron", (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("cauldron"));
  223.         itemRegistry.addObject(381, "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder").setTextureName("ender_eye"));
  224.         itemRegistry.addObject(382, "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled"));
  225.         itemRegistry.addObject(383, "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer").setTextureName("spawn_egg"));
  226.         itemRegistry.addObject(384, "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle").setTextureName("experience_bottle"));
  227.         itemRegistry.addObject(385, "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball").setTextureName("fireball"));
  228.         itemRegistry.addObject(386, "writable_book", (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_writable"));
  229.         itemRegistry.addObject(387, "written_book", (new ItemEditableBook()).setUnlocalizedName("writtenBook").setTextureName("book_written").setMaxStackSize(16));
  230.         itemRegistry.addObject(388, "emerald", (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("emerald"));
  231.         itemRegistry.addObject(389, "item_frame", (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame").setTextureName("item_frame"));
  232.         itemRegistry.addObject(390, "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations).setTextureName("flower_pot"));
  233.         itemRegistry.addObject(391, "carrot", (new ItemSeedFood(4, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots").setTextureName("carrot"));
  234.         itemRegistry.addObject(392, "potato", (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato").setTextureName("potato"));
  235.         itemRegistry.addObject(393, "baked_potato", (new ItemFood(6, 0.6F, false)).setUnlocalizedName("potatoBaked").setTextureName("potato_baked"));
  236.         itemRegistry.addObject(394, "poisonous_potato", (new ItemFood(2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous").setTextureName("potato_poisonous"));
  237.         itemRegistry.addObject(395, "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap").setTextureName("map_empty"));
  238.         itemRegistry.addObject(396, "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setTextureName("carrot_golden"));
  239.         itemRegistry.addObject(397, "skull", (new ItemSkull()).setUnlocalizedName("skull").setTextureName("skull"));
  240.         itemRegistry.addObject(398, "carrot_on_a_stick", (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick").setTextureName("carrot_on_a_stick"));
  241.         itemRegistry.addObject(399, "nether_star", (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("nether_star"));
  242.         itemRegistry.addObject(400, "pumpkin_pie", (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood).setTextureName("pumpkin_pie"));
  243.         itemRegistry.addObject(401, "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks").setTextureName("fireworks"));
  244.         itemRegistry.addObject(402, "firework_charge", (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge"));
  245.         itemRegistry.addObject(403, "enchanted_book", (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted"));
  246.         itemRegistry.addObject(404, "comparator", (new ItemReed(Blocks.unpowered_comparator)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator"));
  247.         itemRegistry.addObject(405, "netherbrick", (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick"));
  248.         itemRegistry.addObject(406, "quartz", (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz"));
  249.         itemRegistry.addObject(407, "tnt_minecart", (new ItemMinecart(3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"));
  250.         itemRegistry.addObject(408, "hopper_minecart", (new ItemMinecart(5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper"));
  251.         itemRegistry.addObject(417, "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor"));
  252.         itemRegistry.addObject(418, "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor"));
  253.         itemRegistry.addObject(419, "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor"));
  254.         itemRegistry.addObject(420, "lead", (new ItemLead()).setUnlocalizedName("leash").setTextureName("lead"));
  255.         itemRegistry.addObject(421, "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag").setTextureName("name_tag"));
  256.         itemRegistry.addObject(422, "command_block_minecart", (new ItemMinecart(6)).setUnlocalizedName("minecartCommandBlock").setTextureName("minecart_command_block").setCreativeTab((CreativeTabs)null));
  257.         itemRegistry.addObject(2256, "record_13", (new ItemRecord("13")).setUnlocalizedName("record").setTextureName("record_13"));
  258.         itemRegistry.addObject(2257, "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record").setTextureName("record_cat"));
  259.         itemRegistry.addObject(2258, "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record").setTextureName("record_blocks"));
  260.         itemRegistry.addObject(2259, "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record").setTextureName("record_chirp"));
  261.         itemRegistry.addObject(2260, "record_far", (new ItemRecord("far")).setUnlocalizedName("record").setTextureName("record_far"));
  262.         itemRegistry.addObject(2261, "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record").setTextureName("record_mall"));
  263.         itemRegistry.addObject(2262, "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record").setTextureName("record_mellohi"));
  264.         itemRegistry.addObject(2263, "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record").setTextureName("record_stal"));
  265.         itemRegistry.addObject(2264, "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record").setTextureName("record_strad"));
  266.         itemRegistry.addObject(2265, "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record").setTextureName("record_ward"));
  267.         itemRegistry.addObject(2266, "record_11", (new ItemRecord("11")).setUnlocalizedName("record").setTextureName("record_11"));
  268.         itemRegistry.addObject(2267, "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record").setTextureName("record_wait"));
  269.        
  270.         // KARYX
  271.         itemRegistry.addObject(423, "citrine", (new Item()).setUnlocalizedName("citrine").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("citrine"));
  272.         itemRegistry.addObject(424, "saphir", (new Item()).setUnlocalizedName("saphir").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("saphir"));
  273.         itemRegistry.addObject(425, "cobalt", (new Item()).setUnlocalizedName("cobalt").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("colbat"));
  274.         itemRegistry.addObject(426, "onyx", (new Item()).setUnlocalizedName("onyx").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("onyx"));
  275.        
  276.         HashSet var1 = Sets.newHashSet(new Block[] {Blocks.air, Blocks.brewing_stand, Blocks.bed, Blocks.nether_wart, Blocks.cauldron, Blocks.flower_pot, Blocks.wheat, Blocks.reeds, Blocks.cake, Blocks.skull, Blocks.piston_head, Blocks.piston_extension, Blocks.lit_redstone_ore, Blocks.powered_repeater, Blocks.pumpkin_stem, Blocks.standing_sign, Blocks.powered_comparator, Blocks.tripwire, Blocks.lit_redstone_lamp, Blocks.melon_stem, Blocks.unlit_redstone_torch, Blocks.unpowered_comparator, Blocks.redstone_wire, Blocks.wall_sign, Blocks.unpowered_repeater, Blocks.iron_door, Blocks.wooden_door});
  277.         Iterator var2 = Block.blockRegistry.getKeys().iterator();
  278.  
  279.         while (var2.hasNext())
  280.         {
  281.             String var3 = (String)var2.next();
  282.             Block var4 = (Block)Block.blockRegistry.getObject(var3);
  283.             Object var5;
  284.  
  285.             if (var4 == Blocks.wool)
  286.             {
  287.                 var5 = (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth");
  288.             }
  289.             else if (var4 == Blocks.stained_hardened_clay)
  290.             {
  291.                 var5 = (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained");
  292.             }
  293.             else if (var4 == Blocks.stained_glass)
  294.             {
  295.                 var5 = (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass");
  296.             }
  297.             else if (var4 == Blocks.stained_glass_pane)
  298.             {
  299.                 var5 = (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane");
  300.             }
  301.             else if (var4 == Blocks.carpet)
  302.             {
  303.                 var5 = (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet");
  304.             }
  305.             else if (var4 == Blocks.dirt)
  306.             {
  307.                 var5 = (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, BlockDirt.field_150009_a)).setUnlocalizedName("dirt");
  308.             }
  309.             else if (var4 == Blocks.sand)
  310.             {
  311.                 var5 = (new ItemMultiTexture(Blocks.sand, Blocks.sand, BlockSand.field_149838_a)).setUnlocalizedName("sand");
  312.             }
  313.             else if (var4 == Blocks.log)
  314.             {
  315.                 var5 = (new ItemMultiTexture(Blocks.log, Blocks.log, BlockOldLog.field_150168_M)).setUnlocalizedName("log");
  316.             }
  317.             else if (var4 == Blocks.log2)
  318.             {
  319.                 var5 = (new ItemMultiTexture(Blocks.log2, Blocks.log2, BlockNewLog.field_150169_M)).setUnlocalizedName("log");
  320.             }
  321.             else if (var4 == Blocks.planks)
  322.             {
  323.                 var5 = (new ItemMultiTexture(Blocks.planks, Blocks.planks, BlockWood.field_150096_a)).setUnlocalizedName("wood");
  324.             }
  325.             else if (var4 == Blocks.monster_egg)
  326.             {
  327.                 var5 = (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, BlockSilverfish.field_150198_a)).setUnlocalizedName("monsterStoneEgg");
  328.             }
  329.             else if (var4 == Blocks.stonebrick)
  330.             {
  331.                 var5 = (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, BlockStoneBrick.field_150142_a)).setUnlocalizedName("stonebricksmooth");
  332.             }
  333.             else if (var4 == Blocks.sandstone)
  334.             {
  335.                 var5 = (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, BlockSandStone.field_150157_a)).setUnlocalizedName("sandStone");
  336.             }
  337.             else if (var4 == Blocks.quartz_block)
  338.             {
  339.                 var5 = (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, BlockQuartz.field_150191_a)).setUnlocalizedName("quartzBlock");
  340.             }
  341.             else if (var4 == Blocks.stone_slab)
  342.             {
  343.                 var5 = (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, false)).setUnlocalizedName("stoneSlab");
  344.             }
  345.             else if (var4 == Blocks.double_stone_slab)
  346.             {
  347.                 var5 = (new ItemSlab(Blocks.double_stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, true)).setUnlocalizedName("stoneSlab");
  348.             }
  349.             else if (var4 == Blocks.wooden_slab)
  350.             {
  351.                 var5 = (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, false)).setUnlocalizedName("woodSlab");
  352.             }
  353.             else if (var4 == Blocks.double_wooden_slab)
  354.             {
  355.                 var5 = (new ItemSlab(Blocks.double_wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, true)).setUnlocalizedName("woodSlab");
  356.             }
  357.             else if (var4 == Blocks.sapling)
  358.             {
  359.                 var5 = (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, BlockSapling.field_149882_a)).setUnlocalizedName("sapling");
  360.             }
  361.             else if (var4 == Blocks.leaves)
  362.             {
  363.                 var5 = (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves");
  364.             }
  365.             else if (var4 == Blocks.leaves2)
  366.             {
  367.                 var5 = (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves");
  368.             }
  369.             else if (var4 == Blocks.vine)
  370.             {
  371.                 var5 = new ItemColored(Blocks.vine, false);
  372.             }
  373.             else if (var4 == Blocks.tallgrass)
  374.             {
  375.                 var5 = (new ItemColored(Blocks.tallgrass, true)).func_150943_a(new String[] {"shrub", "grass", "fern"});
  376.             }
  377.             else if (var4 == Blocks.yellow_flower)
  378.             {
  379.                 var5 = (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, BlockFlower.field_149858_b)).setUnlocalizedName("flower");
  380.             }
  381.             else if (var4 == Blocks.red_flower)
  382.             {
  383.                 var5 = (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, BlockFlower.field_149859_a)).setUnlocalizedName("rose");
  384.             }
  385.             else if (var4 == Blocks.snow_layer)
  386.             {
  387.                 var5 = new ItemSnow(Blocks.snow_layer, Blocks.snow_layer);
  388.             }
  389.             else if (var4 == Blocks.waterlily)
  390.             {
  391.                 var5 = new ItemLilyPad(Blocks.waterlily);
  392.             }
  393.             else if (var4 == Blocks.piston)
  394.             {
  395.                 var5 = new ItemPiston(Blocks.piston);
  396.             }
  397.             else if (var4 == Blocks.sticky_piston)
  398.             {
  399.                 var5 = new ItemPiston(Blocks.sticky_piston);
  400.             }
  401.             else if (var4 == Blocks.cobblestone_wall)
  402.             {
  403.                 var5 = (new ItemMultiTexture(Blocks.cobblestone_wall, Blocks.cobblestone_wall, BlockWall.field_150092_a)).setUnlocalizedName("cobbleWall");
  404.             }
  405.             else if (var4 == Blocks.anvil)
  406.             {
  407.                 var5 = (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil");
  408.             }
  409.             else if (var4 == Blocks.double_plant)
  410.             {
  411.                 var5 = (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, BlockDoublePlant.field_149892_a)).setUnlocalizedName("doublePlant");
  412.             }
  413.             else
  414.             {
  415.                 if (var1.contains(var4))
  416.                 {
  417.                     continue;
  418.                 }
  419.  
  420.                 var5 = new ItemBlock(var4);
  421.             }
  422.  
  423.             itemRegistry.addObject(Block.getIdFromBlock(var4), var3, var5);
  424.         }
  425.     }
  426.  
  427.     public Item setMaxStackSize(int p_77625_1_)
  428.     {
  429.         this.maxStackSize = p_77625_1_;
  430.         return this;
  431.     }
  432.  
  433.     /**
  434.      * Returns 0 for /terrain.png, 1 for /gui/items.png
  435.      */
  436.     public int getSpriteNumber()
  437.     {
  438.         return 1;
  439.     }
  440.  
  441.     /**
  442.      * Gets an icon index based on an item's damage value
  443.      */
  444.     public IIcon getIconFromDamage(int p_77617_1_)
  445.     {
  446.         return this.itemIcon;
  447.     }
  448.  
  449.     /**
  450.      * Returns the icon index of the stack given as argument.
  451.      */
  452.     public final IIcon getIconIndex(ItemStack p_77650_1_)
  453.     {
  454.         return this.getIconFromDamage(p_77650_1_.getItemDamage());
  455.     }
  456.  
  457.     /**
  458.      * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
  459.      * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
  460.      */
  461.     public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
  462.     {
  463.         return false;
  464.     }
  465.  
  466.     public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_)
  467.     {
  468.         return 1.0F;
  469.     }
  470.  
  471.     /**
  472.      * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
  473.      */
  474.     public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
  475.     {
  476.         return p_77659_1_;
  477.     }
  478.  
  479.     public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_)
  480.     {
  481.         return p_77654_1_;
  482.     }
  483.  
  484.     /**
  485.      * Returns the maximum size of the stack for a specific item.
  486.      */
  487.     public int getItemStackLimit()
  488.     {
  489.         return this.maxStackSize;
  490.     }
  491.  
  492.     /**
  493.      * Returns the metadata of the block which this Item (ItemBlock) can place
  494.      */
  495.     public int getMetadata(int p_77647_1_)
  496.     {
  497.         return 0;
  498.     }
  499.  
  500.     public boolean getHasSubtypes()
  501.     {
  502.         return this.hasSubtypes;
  503.     }
  504.  
  505.     protected Item setHasSubtypes(boolean p_77627_1_)
  506.     {
  507.         this.hasSubtypes = p_77627_1_;
  508.         return this;
  509.     }
  510.  
  511.     /**
  512.      * Returns the maximum damage an item can take.
  513.      */
  514.     public int getMaxDamage()
  515.     {
  516.         return this.maxDamage;
  517.     }
  518.  
  519.     /**
  520.      * set max damage of an Item
  521.      */
  522.     protected Item setMaxDamage(int p_77656_1_)
  523.     {
  524.         this.maxDamage = p_77656_1_;
  525.         return this;
  526.     }
  527.  
  528.     public boolean isDamageable()
  529.     {
  530.         return this.maxDamage > 0 && !this.hasSubtypes;
  531.     }
  532.  
  533.     /**
  534.      * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
  535.      * the damage on the stack.
  536.      */
  537.     public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_)
  538.     {
  539.         return false;
  540.     }
  541.  
  542.     public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_)
  543.     {
  544.         return false;
  545.     }
  546.  
  547.     public boolean func_150897_b(Block p_150897_1_)
  548.     {
  549.         return false;
  550.     }
  551.  
  552.     /**
  553.      * Returns true if the item can be used on the given entity, e.g. shears on sheep.
  554.      */
  555.     public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_)
  556.     {
  557.         return false;
  558.     }
  559.  
  560.     /**
  561.      * Sets bFull3D to True and return the object.
  562.      */
  563.     public Item setFull3D()
  564.     {
  565.         this.bFull3D = true;
  566.         return this;
  567.     }
  568.  
  569.     /**
  570.      * Returns True is the item is renderer in full 3D when hold.
  571.      */
  572.     public boolean isFull3D()
  573.     {
  574.         return this.bFull3D;
  575.     }
  576.  
  577.     /**
  578.      * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
  579.      * hands.
  580.      */
  581.     public boolean shouldRotateAroundWhenRendering()
  582.     {
  583.         return false;
  584.     }
  585.  
  586.     /**
  587.      * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item."
  588.      */
  589.     public Item setUnlocalizedName(String p_77655_1_)
  590.     {
  591.         this.unlocalizedName = p_77655_1_;
  592.         return this;
  593.     }
  594.  
  595.     /**
  596.      * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the
  597.      * unlocalized name itself is returned.
  598.      */
  599.     public String getUnlocalizedNameInefficiently(ItemStack p_77657_1_)
  600.     {
  601.         String var2 = this.getUnlocalizedName(p_77657_1_);
  602.         return var2 == null ? "" : StatCollector.translateToLocal(var2);
  603.     }
  604.  
  605.     /**
  606.      * Returns the unlocalized name of this item.
  607.      */
  608.     public String getUnlocalizedName()
  609.     {
  610.         return "item." + this.unlocalizedName;
  611.     }
  612.  
  613.     /**
  614.      * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
  615.      * different names based on their damage or NBT.
  616.      */
  617.     public String getUnlocalizedName(ItemStack p_77667_1_)
  618.     {
  619.         return "item." + this.unlocalizedName;
  620.     }
  621.  
  622.     public Item setContainerItem(Item p_77642_1_)
  623.     {
  624.         this.containerItem = p_77642_1_;
  625.         return this;
  626.     }
  627.  
  628.     /**
  629.      * If this returns true, after a recipe involving this item is crafted the container item will be added to the
  630.      * player's inventory instead of remaining in the crafting grid.
  631.      */
  632.     public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_)
  633.     {
  634.         return true;
  635.     }
  636.  
  637.     /**
  638.      * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
  639.      */
  640.     public boolean getShareTag()
  641.     {
  642.         return true;
  643.     }
  644.  
  645.     public Item getContainerItem()
  646.     {
  647.         return this.containerItem;
  648.     }
  649.  
  650.     /**
  651.      * True if this Item has a container item (a.k.a. crafting result)
  652.      */
  653.     public boolean hasContainerItem()
  654.     {
  655.         return this.containerItem != null;
  656.     }
  657.  
  658.     public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_)
  659.     {
  660.         return 16777215;
  661.     }
  662.  
  663.     /**
  664.      * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
  665.      * update it's contents.
  666.      */
  667.     public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {}
  668.  
  669.     /**
  670.      * Called when item is crafted/smelted. Used only by maps so far.
  671.      */
  672.     public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) {}
  673.  
  674.     /**
  675.      * false for all Items except sub-classes of ItemMapBase
  676.      */
  677.     public boolean isMap()
  678.     {
  679.         return false;
  680.     }
  681.  
  682.     /**
  683.      * returns the action that specifies what animation to play when the items is being used
  684.      */
  685.     public EnumAction getItemUseAction(ItemStack p_77661_1_)
  686.     {
  687.         return EnumAction.none;
  688.     }
  689.  
  690.     /**
  691.      * How long it takes to use or consume an item
  692.      */
  693.     public int getMaxItemUseDuration(ItemStack p_77626_1_)
  694.     {
  695.         return 0;
  696.     }
  697.  
  698.     /**
  699.      * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
  700.      */
  701.     public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {}
  702.  
  703.     /**
  704.      * Sets the string representing this item's effect on a potion when used as an ingredient.
  705.      */
  706.     protected Item setPotionEffect(String p_77631_1_)
  707.     {
  708.         this.potionEffect = p_77631_1_;
  709.         return this;
  710.     }
  711.  
  712.     public String getPotionEffect(ItemStack p_150896_1_)
  713.     {
  714.         return this.potionEffect;
  715.     }
  716.  
  717.     public boolean isPotionIngredient(ItemStack p_150892_1_)
  718.     {
  719.         return this.getPotionEffect(p_150892_1_) != null;
  720.     }
  721.  
  722.     /**
  723.      * allows items to add custom lines of information to the mouseover description
  724.      */
  725.     public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {}
  726.  
  727.     public String getItemStackDisplayName(ItemStack p_77653_1_)
  728.     {
  729.         return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim();
  730.     }
  731.  
  732.     public boolean hasEffect(ItemStack p_77636_1_)
  733.     {
  734.         return p_77636_1_.isItemEnchanted();
  735.     }
  736.  
  737.     /**
  738.      * Return an item rarity from EnumRarity
  739.      */
  740.     public EnumRarity getRarity(ItemStack p_77613_1_)
  741.     {
  742.         return p_77613_1_.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common;
  743.     }
  744.  
  745.     /**
  746.      * Checks isDamagable and if it cannot be stacked
  747.      */
  748.     public boolean isItemTool(ItemStack p_77616_1_)
  749.     {
  750.         return this.getItemStackLimit() == 1 && this.isDamageable();
  751.     }
  752.  
  753.     protected MovingObjectPosition getMovingObjectPositionFromPlayer(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_)
  754.     {
  755.         float var4 = 1.0F;
  756.         float var5 = p_77621_2_.prevRotationPitch + (p_77621_2_.rotationPitch - p_77621_2_.prevRotationPitch) * var4;
  757.         float var6 = p_77621_2_.prevRotationYaw + (p_77621_2_.rotationYaw - p_77621_2_.prevRotationYaw) * var4;
  758.         double var7 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)var4;
  759.         double var9 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)var4 + 1.62D - (double)p_77621_2_.yOffset;
  760.         double var11 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)var4;
  761.         Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11);
  762.         float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
  763.         float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
  764.         float var16 = -MathHelper.cos(-var5 * 0.017453292F);
  765.         float var17 = MathHelper.sin(-var5 * 0.017453292F);
  766.         float var18 = var15 * var16;
  767.         float var20 = var14 * var16;
  768.         double var21 = 5.0D;
  769.         Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
  770.         return p_77621_1_.func_147447_a(var13, var23, p_77621_3_, !p_77621_3_, false);
  771.     }
  772.  
  773.     /**
  774.      * Return the enchantability factor of the item, most of the time is based on material.
  775.      */
  776.     public int getItemEnchantability()
  777.     {
  778.         return 0;
  779.     }
  780.  
  781.     public boolean requiresMultipleRenderPasses()
  782.     {
  783.         return false;
  784.     }
  785.  
  786.     /**
  787.      * Gets an icon index based on an item's damage value and the given render pass
  788.      */
  789.     public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_)
  790.     {
  791.         return this.getIconFromDamage(p_77618_1_);
  792.     }
  793.  
  794.     /**
  795.      * This returns the sub items
  796.      */
  797.     public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
  798.     {
  799.         p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0));
  800.     }
  801.  
  802.     /**
  803.      * gets the CreativeTab this item is displayed on
  804.      */
  805.     public CreativeTabs getCreativeTab()
  806.     {
  807.         return this.tabToDisplayOn;
  808.     }
  809.  
  810.     /**
  811.      * returns this;
  812.      */
  813.     public Item setCreativeTab(CreativeTabs p_77637_1_)
  814.     {
  815.         this.tabToDisplayOn = p_77637_1_;
  816.         return this;
  817.     }
  818.  
  819.     /**
  820.      * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal)
  821.      * when not in creative
  822.      */
  823.     public boolean canItemEditBlocks()
  824.     {
  825.         return true;
  826.     }
  827.  
  828.     /**
  829.      * Return whether this item is repairable in an anvil.
  830.      */
  831.     public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_)
  832.     {
  833.         return false;
  834.     }
  835.  
  836.     public void registerIcons(IIconRegister p_94581_1_)
  837.     {
  838.         this.itemIcon = p_94581_1_.registerIcon(this.getIconString());
  839.     }
  840.  
  841.     /**
  842.      * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
  843.      */
  844.     public Multimap getItemAttributeModifiers()
  845.     {
  846.         return HashMultimap.create();
  847.     }
  848.  
  849.     protected Item setTextureName(String p_111206_1_)
  850.     {
  851.         this.iconString = p_111206_1_;
  852.         return this;
  853.     }
  854.  
  855.     /**
  856.      * Returns the string associated with this Item's Icon.
  857.      */
  858.     protected String getIconString()
  859.     {
  860.         return this.iconString == null ? "MISSING_ICON_ITEM_" + itemRegistry.getIDForObject(this) + "_" + this.unlocalizedName : this.iconString;
  861.     }
  862.  
  863.     public static enum ToolMaterial
  864.     {
  865.         WOOD("WOOD", 0, 0, 59, 2.0F, 0.0F, 15),
  866.         STONE("STONE", 1, 1, 131, 4.0F, 1.0F, 5),
  867.         IRON("IRON", 2, 2, 250, 6.0F, 2.0F, 14),
  868.         EMERALD("EMERALD", 3, 3, 1561, 8.0F, 3.0F, 10),
  869.         GOLD("GOLD", 4, 0, 32, 12.0F, 0.0F, 22);
  870.         private final int harvestLevel;
  871.         private final int maxUses;
  872.         private final float efficiencyOnProperMaterial;
  873.         private final float damageVsEntity;
  874.         private final int enchantability;
  875.  
  876.         private static final Item.ToolMaterial[] $VALUES = new Item.ToolMaterial[]{WOOD, STONE, IRON, EMERALD, GOLD};
  877.         private static final String __OBFID = "CL_00000042";
  878.  
  879.         private ToolMaterial(String p_i1874_1_, int p_i1874_2_, int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_)
  880.         {
  881.             this.harvestLevel = p_i1874_3_;
  882.             this.maxUses = p_i1874_4_;
  883.             this.efficiencyOnProperMaterial = p_i1874_5_;
  884.             this.damageVsEntity = p_i1874_6_;
  885.             this.enchantability = p_i1874_7_;
  886.         }
  887.  
  888.         public int getMaxUses()
  889.         {
  890.             return this.maxUses;
  891.         }
  892.  
  893.         public float getEfficiencyOnProperMaterial()
  894.         {
  895.             return this.efficiencyOnProperMaterial;
  896.         }
  897.  
  898.         public float getDamageVsEntity()
  899.         {
  900.             return this.damageVsEntity;
  901.         }
  902.  
  903.         public int getHarvestLevel()
  904.         {
  905.             return this.harvestLevel;
  906.         }
  907.  
  908.         public int getEnchantability()
  909.         {
  910.             return this.enchantability;
  911.         }
  912.  
  913.         public Item func_150995_f()
  914.         {
  915.             return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null))));
  916.         }
  917.     }
  918. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top