Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 257 lines 13 kB view raw
1package net.minecraft.server; 2 3import java.util.Random; 4 5public class Item { 6 7 protected static Random b = new Random(); 8 public static Item[] byId = new Item[32000]; 9 public static Item IRON_SPADE = (new ItemSpade(0, EnumToolMaterial.IRON)).a(2, 5).a("shovelIron"); 10 public static Item IRON_PICKAXE = (new ItemPickaxe(1, EnumToolMaterial.IRON)).a(2, 6).a("pickaxeIron"); 11 public static Item IRON_AXE = (new ItemAxe(2, EnumToolMaterial.IRON)).a(2, 7).a("hatchetIron"); 12 public static Item FLINT_AND_STEEL = (new ItemFlintAndSteel(3)).a(5, 0).a("flintAndSteel"); 13 public static Item APPLE = (new ItemFood(4, 4, false)).a(10, 0).a("apple"); 14 public static Item BOW = (new ItemBow(5)).a(5, 1).a("bow"); 15 public static Item ARROW = (new Item(6)).a(5, 2).a("arrow"); 16 public static Item COAL = (new ItemCoal(7)).a(7, 0).a("coal"); 17 public static Item DIAMOND = (new Item(8)).a(7, 3).a("emerald"); 18 public static Item IRON_INGOT = (new Item(9)).a(7, 1).a("ingotIron"); 19 public static Item GOLD_INGOT = (new Item(10)).a(7, 2).a("ingotGold"); 20 public static Item IRON_SWORD = (new ItemSword(11, EnumToolMaterial.IRON)).a(2, 4).a("swordIron"); 21 public static Item WOOD_SWORD = (new ItemSword(12, EnumToolMaterial.WOOD)).a(0, 4).a("swordWood"); 22 public static Item WOOD_SPADE = (new ItemSpade(13, EnumToolMaterial.WOOD)).a(0, 5).a("shovelWood"); 23 public static Item WOOD_PICKAXE = (new ItemPickaxe(14, EnumToolMaterial.WOOD)).a(0, 6).a("pickaxeWood"); 24 public static Item WOOD_AXE = (new ItemAxe(15, EnumToolMaterial.WOOD)).a(0, 7).a("hatchetWood"); 25 public static Item STONE_SWORD = (new ItemSword(16, EnumToolMaterial.STONE)).a(1, 4).a("swordStone"); 26 public static Item STONE_SPADE = (new ItemSpade(17, EnumToolMaterial.STONE)).a(1, 5).a("shovelStone"); 27 public static Item STONE_PICKAXE = (new ItemPickaxe(18, EnumToolMaterial.STONE)).a(1, 6).a("pickaxeStone"); 28 public static Item STONE_AXE = (new ItemAxe(19, EnumToolMaterial.STONE)).a(1, 7).a("hatchetStone"); 29 public static Item DIAMOND_SWORD = (new ItemSword(20, EnumToolMaterial.DIAMOND)).a(3, 4).a("swordDiamond"); 30 public static Item DIAMOND_SPADE = (new ItemSpade(21, EnumToolMaterial.DIAMOND)).a(3, 5).a("shovelDiamond"); 31 public static Item DIAMOND_PICKAXE = (new ItemPickaxe(22, EnumToolMaterial.DIAMOND)).a(3, 6).a("pickaxeDiamond"); 32 public static Item DIAMOND_AXE = (new ItemAxe(23, EnumToolMaterial.DIAMOND)).a(3, 7).a("hatchetDiamond"); 33 public static Item STICK = (new Item(24)).a(5, 3).g().a("stick"); 34 public static Item BOWL = (new Item(25)).a(7, 4).a("bowl"); 35 public static Item MUSHROOM_SOUP = (new ItemSoup(26, 10)).a(8, 4).a("mushroomStew"); 36 public static Item GOLD_SWORD = (new ItemSword(27, EnumToolMaterial.GOLD)).a(4, 4).a("swordGold"); 37 public static Item GOLD_SPADE = (new ItemSpade(28, EnumToolMaterial.GOLD)).a(4, 5).a("shovelGold"); 38 public static Item GOLD_PICKAXE = (new ItemPickaxe(29, EnumToolMaterial.GOLD)).a(4, 6).a("pickaxeGold"); 39 public static Item GOLD_AXE = (new ItemAxe(30, EnumToolMaterial.GOLD)).a(4, 7).a("hatchetGold"); 40 public static Item STRING = (new Item(31)).a(8, 0).a("string"); 41 public static Item FEATHER = (new Item(32)).a(8, 1).a("feather"); 42 public static Item SULPHUR = (new Item(33)).a(8, 2).a("sulphur"); 43 public static Item WOOD_HOE = (new ItemHoe(34, EnumToolMaterial.WOOD)).a(0, 8).a("hoeWood"); 44 public static Item STONE_HOE = (new ItemHoe(35, EnumToolMaterial.STONE)).a(1, 8).a("hoeStone"); 45 public static Item IRON_HOE = (new ItemHoe(36, EnumToolMaterial.IRON)).a(2, 8).a("hoeIron"); 46 public static Item DIAMOND_HOE = (new ItemHoe(37, EnumToolMaterial.DIAMOND)).a(3, 8).a("hoeDiamond"); 47 public static Item GOLD_HOE = (new ItemHoe(38, EnumToolMaterial.GOLD)).a(4, 8).a("hoeGold"); 48 public static Item SEEDS = (new ItemSeeds(39, Block.CROPS.id)).a(9, 0).a("seeds"); 49 public static Item WHEAT = (new Item(40)).a(9, 1).a("wheat"); 50 public static Item BREAD = (new ItemFood(41, 5, false)).a(9, 2).a("bread"); 51 public static Item LEATHER_HELMET = (new ItemArmor(42, 0, 0, 0)).a(0, 0).a("helmetCloth"); 52 public static Item LEATHER_CHESTPLATE = (new ItemArmor(43, 0, 0, 1)).a(0, 1).a("chestplateCloth"); 53 public static Item LEATHER_LEGGINGS = (new ItemArmor(44, 0, 0, 2)).a(0, 2).a("leggingsCloth"); 54 public static Item LEATHER_BOOTS = (new ItemArmor(45, 0, 0, 3)).a(0, 3).a("bootsCloth"); 55 public static Item CHAINMAIL_HELMET = (new ItemArmor(46, 1, 1, 0)).a(1, 0).a("helmetChain"); 56 public static Item CHAINMAIL_CHESTPLATE = (new ItemArmor(47, 1, 1, 1)).a(1, 1).a("chestplateChain"); 57 public static Item CHAINMAIL_LEGGINGS = (new ItemArmor(48, 1, 1, 2)).a(1, 2).a("leggingsChain"); 58 public static Item CHAINMAIL_BOOTS = (new ItemArmor(49, 1, 1, 3)).a(1, 3).a("bootsChain"); 59 public static Item IRON_HELMET = (new ItemArmor(50, 2, 2, 0)).a(2, 0).a("helmetIron"); 60 public static Item IRON_CHESTPLATE = (new ItemArmor(51, 2, 2, 1)).a(2, 1).a("chestplateIron"); 61 public static Item IRON_LEGGINGS = (new ItemArmor(52, 2, 2, 2)).a(2, 2).a("leggingsIron"); 62 public static Item IRON_BOOTS = (new ItemArmor(53, 2, 2, 3)).a(2, 3).a("bootsIron"); 63 public static Item DIAMOND_HELMET = (new ItemArmor(54, 3, 3, 0)).a(3, 0).a("helmetDiamond"); 64 public static Item DIAMOND_CHESTPLATE = (new ItemArmor(55, 3, 3, 1)).a(3, 1).a("chestplateDiamond"); 65 public static Item DIAMOND_LEGGINGS = (new ItemArmor(56, 3, 3, 2)).a(3, 2).a("leggingsDiamond"); 66 public static Item DIAMOND_BOOTS = (new ItemArmor(57, 3, 3, 3)).a(3, 3).a("bootsDiamond"); 67 public static Item GOLD_HELMET = (new ItemArmor(58, 1, 4, 0)).a(4, 0).a("helmetGold"); 68 public static Item GOLD_CHESTPLATE = (new ItemArmor(59, 1, 4, 1)).a(4, 1).a("chestplateGold"); 69 public static Item GOLD_LEGGINGS = (new ItemArmor(60, 1, 4, 2)).a(4, 2).a("leggingsGold"); 70 public static Item GOLD_BOOTS = (new ItemArmor(61, 1, 4, 3)).a(4, 3).a("bootsGold"); 71 public static Item FLINT = (new Item(62)).a(6, 0).a("flint"); 72 public static Item PORK = (new ItemFood(63, 3, true)).a(7, 5).a("porkchopRaw"); 73 public static Item GRILLED_PORK = (new ItemFood(64, 8, true)).a(8, 5).a("porkchopCooked"); 74 public static Item PAINTING = (new ItemPainting(65)).a(10, 1).a("painting"); 75 public static Item GOLDEN_APPLE = (new ItemFood(66, 42, false)).a(11, 0).a("appleGold"); 76 public static Item SIGN = (new ItemSign(67)).a(10, 2).a("sign"); 77 public static Item WOOD_DOOR = (new ItemDoor(68, Material.WOOD)).a(11, 2).a("doorWood"); 78 public static Item BUCKET = (new ItemBucket(69, 0)).a(10, 4).a("bucket"); 79 public static Item WATER_BUCKET = (new ItemBucket(70, Block.WATER.id)).a(11, 4).a("bucketWater").a(BUCKET); 80 public static Item LAVA_BUCKET = (new ItemBucket(71, Block.LAVA.id)).a(12, 4).a("bucketLava").a(BUCKET); 81 public static Item MINECART = (new ItemMinecart(72, 0)).a(7, 8).a("minecart"); 82 public static Item SADDLE = (new ItemSaddle(73)).a(8, 6).a("saddle"); 83 public static Item IRON_DOOR = (new ItemDoor(74, Material.ORE)).a(12, 2).a("doorIron"); 84 public static Item REDSTONE = (new ItemRedstone(75)).a(8, 3).a("redstone"); 85 public static Item SNOW_BALL = (new ItemSnowball(76)).a(14, 0).a("snowball"); 86 public static Item BOAT = (new ItemBoat(77)).a(8, 8).a("boat"); 87 public static Item LEATHER = (new Item(78)).a(7, 6).a("leather"); 88 public static Item MILK_BUCKET = (new ItemBucket(79, -1)).a(13, 4).a("milk").a(BUCKET); 89 public static Item CLAY_BRICK = (new Item(80)).a(6, 1).a("brick"); 90 public static Item CLAY_BALL = (new Item(81)).a(9, 3).a("clay"); 91 public static Item SUGAR_CANE = (new ItemReed(82, Block.SUGAR_CANE_BLOCK)).a(11, 1).a("reeds"); 92 public static Item PAPER = (new Item(83)).a(10, 3).a("paper"); 93 public static Item BOOK = (new Item(84)).a(11, 3).a("book"); 94 public static Item SLIME_BALL = (new Item(85)).a(14, 1).a("slimeball"); 95 public static Item STORAGE_MINECART = (new ItemMinecart(86, 1)).a(7, 9).a("minecartChest"); 96 public static Item POWERED_MINECART = (new ItemMinecart(87, 2)).a(7, 10).a("minecartFurnace"); 97 public static Item EGG = (new ItemEgg(88)).a(12, 0).a("egg"); 98 public static Item COMPASS = (new Item(89)).a(6, 3).a("compass"); 99 public static Item FISHING_ROD = (new ItemFishingRod(90)).a(5, 4).a("fishingRod"); 100 public static Item WATCH = (new Item(91)).a(6, 4).a("clock"); 101 public static Item GLOWSTONE_DUST = (new Item(92)).a(9, 4).a("yellowDust"); 102 public static Item RAW_FISH = (new ItemFood(93, 2, false)).a(9, 5).a("fishRaw"); 103 public static Item COOKED_FISH = (new ItemFood(94, 5, false)).a(10, 5).a("fishCooked"); 104 public static Item INK_SACK = (new ItemDye(95)).a(14, 4).a("dyePowder"); 105 public static Item BONE = (new Item(96)).a(12, 1).a("bone").g(); 106 public static Item SUGAR = (new Item(97)).a(13, 0).a("sugar").g(); 107 public static Item CAKE = (new ItemReed(98, Block.CAKE_BLOCK)).c(1).a(13, 1).a("cake"); 108 public static Item BED = (new ItemBed(99)).c(1).a(13, 2).a("bed"); 109 public static Item DIODE = (new ItemReed(100, Block.DIODE_OFF)).a(6, 5).a("diode"); 110 public static Item COOKIE = (new ItemCookie(101, 1, false, 8)).a(12, 5).a("cookie"); 111 public static ItemWorldMap MAP = (ItemWorldMap) (new ItemWorldMap(102)).a(12, 3).a("map"); 112 public static ItemShears SHEARS = (ItemShears) (new ItemShears(103)).a(13, 5).a("shears"); 113 public static Item GOLD_RECORD = (new ItemRecord(2000, "13")).a(0, 15).a("record"); 114 public static Item GREEN_RECORD = (new ItemRecord(2001, "cat")).a(1, 15).a("record"); 115 public final int id; 116 protected int maxStackSize = 64; 117 private int durability = 0; 118 protected int textureId; 119 protected boolean bi = false; 120 protected boolean bj = false; 121 private Item craftingResult = null; 122 private String name; 123 124 protected Item(int i) { 125 this.id = 256 + i; 126 if (byId[256 + i] != null) { 127 System.out.println("CONFLICT @ " + i); 128 } 129 130 byId[256 + i] = this; 131 } 132 133 public Item b(int i) { 134 this.textureId = i; 135 return this; 136 } 137 138 public Item c(int i) { 139 this.maxStackSize = i; 140 return this; 141 } 142 143 public Item a(int i, int j) { 144 this.textureId = i + j * 16; 145 return this; 146 } 147 148 public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) { 149 return false; 150 } 151 152 public float a(ItemStack itemstack, Block block) { 153 return 1.0F; 154 } 155 156 public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) { 157 return itemstack; 158 } 159 160 public int getMaxStackSize() { 161 return this.maxStackSize; 162 } 163 164 public int filterData(int i) { 165 return 0; 166 } 167 168 public boolean d() { 169 return this.bj; 170 } 171 172 protected Item a(boolean flag) { 173 this.bj = flag; 174 return this; 175 } 176 177 public int e() { 178 return this.durability; 179 } 180 181 protected Item d(int i) { 182 this.durability = i; 183 return this; 184 } 185 186 public boolean f() { 187 return this.durability > 0 && !this.bj; 188 } 189 190 public boolean a(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { 191 return false; 192 } 193 194 public boolean a(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) { 195 return false; 196 } 197 198 public int a(Entity entity) { 199 return 1; 200 } 201 202 public boolean a(Block block) { 203 return false; 204 } 205 206 public void a(ItemStack itemstack, EntityLiving entityliving) { 207 } 208 209 public Item g() { 210 this.bi = true; 211 return this; 212 } 213 214 public Item a(String s) { 215 this.name = "item." + s; 216 return this; 217 } 218 219 public String a() { 220 return this.name; 221 } 222 223 public Item a(Item item) { 224 if (this.maxStackSize > 1) { 225 throw new IllegalArgumentException("Max stack size must be 1 for items with crafting results"); 226 } else { 227 this.craftingResult = item; 228 return this; 229 } 230 } 231 232 public Item h() { 233 return this.craftingResult; 234 } 235 236 public boolean i() { 237 return this.craftingResult != null; 238 } 239 240 public String j() { 241 return StatisticCollector.a(this.a() + ".name"); 242 } 243 244 public void a(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { 245 } 246 247 public void c(ItemStack itemstack, World world, EntityHuman entityhuman) { 248 } 249 250 public boolean b() { 251 return false; 252 } 253 254 static { 255 StatisticList.c(); 256 } 257}