Item .java

net.minecraft.item.Item (class, 1036 lines): members: getMovingObjectPositionFromPlayer, getUnlocalizedNameInefficiently, isPotionIngredient, bFull3D.

net.minecraft.itemclass1,036 linescommon52.7 KB

API Surface (80)

int getIdFromItem(Item itemIn)
Item getItemById(int id)
Item getItemFromBlock(Block blockIn)
Item getByNameOrId(String id)
boolean updateItemStackNBT(NBTTagCompound nbt)
Item setMaxStackSize(int maxStackSize)
boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
float getStrVsBlock(ItemStack stack, Block state)
ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
int getItemStackLimit()
int getMetadata(int damage)
boolean getHasSubtypes()
Item setHasSubtypes(boolean hasSubtypes)
int getMaxDamage()
Item setMaxDamage(int maxDamageIn)
boolean isDamageable()
boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn)
boolean canHarvestBlock(Block blockIn)
boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
Item setFull3D()
boolean isFull3D()
boolean shouldRotateAroundWhenRendering()
Item setUnlocalizedName(String unlocalizedName)
String getUnlocalizedNameInefficiently(ItemStack stack)
String getUnlocalizedName()
String getUnlocalizedName(ItemStack stack)
Item setContainerItem(Item containerItem)
boolean getShareTag()
Item getContainerItem()
boolean hasContainerItem()
int getColorFromItemStack(ItemStack stack, int renderPass)
void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn)
boolean isMap()
EnumAction getItemUseAction(ItemStack stack)
int getMaxItemUseDuration(ItemStack stack)
void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft)
Item setPotionEffect(String potionEffect)
String getPotionEffect(ItemStack stack)
boolean isPotionIngredient(ItemStack stack)
void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
String getItemStackDisplayName(ItemStack stack)
boolean hasEffect(ItemStack stack)
EnumRarity getRarity(ItemStack stack)
boolean isItemTool(ItemStack stack)
MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids)
int getItemEnchantability()
void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
CreativeTabs getCreativeTab()
Item setCreativeTab(CreativeTabs tab)
boolean canItemEditBlocks()
boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
Multimap<String, AttributeModifier> getItemAttributeModifiers()
void registerItems()
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
String apply(ItemStack p_apply_1_)
void registerItemBlock(Block blockIn, Item itemIn)
int getMaxUses()
float getEfficiencyOnProperMaterial()
float getDamageVsEntity()
int getHarvestLevel()
int getEnchantability()
Item getRepairItem()

Fields & Constants (12)

itemRegistry
BLOCK_TO_ITEM
itemModifierUUID
tabToDisplayOn
itemRand
maxStackSize
maxDamage
bFull3D
hasSubtypes
containerItem
potionEffect
unlocalizedName

String literals (353)

"item."
".name"
"stone"
"dirt"
"wood"
"sapling"
"sand"
"leaves"
"sponge"
"sandStone"
"shrub"
"grass"
"fern"
"cloth"
"flower"
"rose"
"stoneSlab"
"monsterStoneEgg"
"stonebricksmooth"
"woodSlab"
"cobbleWall"
"anvil"
"default"
"chiseled"

Full Source

Item.java1036 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.item;
2
3
import com.google.common.base.Function;
4
import com.google.common.collect.HashMultimap;
5
import com.google.common.collect.Maps;
6
import com.google.common.collect.Multimap;
7
import java.util.List;
8
import java.util.Map;
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.BlockPlanks;
16
import net.minecraft.block.BlockPrismarine;
17
import net.minecraft.block.BlockRedSandstone;
18
import net.minecraft.block.BlockSand;
19
import net.minecraft.block.BlockSandStone;
20
import net.minecraft.block.BlockSilverfish;
21
import net.minecraft.block.BlockStone;
22
import net.minecraft.block.BlockStoneBrick;
23
import net.minecraft.block.BlockWall;
24
import net.minecraft.creativetab.CreativeTabs;
25
import net.minecraft.entity.Entity;
26
import net.minecraft.entity.EntityLivingBase;
27
import net.minecraft.entity.ai.attributes.AttributeModifier;
28
import net.minecraft.entity.item.EntityItemFrame;
29
import net.minecraft.entity.item.EntityMinecart;
30
import net.minecraft.entity.item.EntityPainting;
31
import net.minecraft.entity.player.EntityPlayer;
32
import net.minecraft.init.Blocks;
33
import net.minecraft.init.Items;
34
import net.minecraft.nbt.NBTTagCompound;
35
import net.minecraft.potion.Potion;
36
import net.minecraft.potion.PotionHelper;
37
import net.minecraft.util.BlockPos;
38
import net.minecraft.util.EnumFacing;
39
import net.minecraft.util.MathHelper;
40
import net.minecraft.util.MovingObjectPosition;
41
import net.minecraft.util.RegistryNamespaced;
42
import net.minecraft.util.ResourceLocation;
43
import net.minecraft.util.StatCollector;
44
import net.minecraft.util.Vec3;
45
import net.minecraft.world.World;
46
47
public class Item
48
{
49
    public static final RegistryNamespaced<ResourceLocation, Item> itemRegistry = new RegistryNamespaced();
50
    private static final Map<Block, Item> BLOCK_TO_ITEM = Maps.<Block, Item>newHashMap();
51
    protected static final UUID itemModifierUUID = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
52
    private CreativeTabs tabToDisplayOn;
53
54
    /** The RNG used by the Item subclasses. */
55
    protected static Random itemRand = new Random();
56
57
    /** Maximum size of the stack. */
58
    protected int maxStackSize = 64;
59
60
    /** Maximum damage an item can handle. */
61
    private int maxDamage;
62
63
    /** If true, render the object in full 3D, like weapons and tools. */
64
    protected boolean bFull3D;
65
66
    /**
67
     * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior
68
     */
69
    protected boolean hasSubtypes;
70
    private Item containerItem;
71
72
    /**
73
     * The string representing this item's effect on a potion when used as an ingredient.
74
     */
75
    private String potionEffect;
76
77
    /** The unlocalized name of this item. */
78
    private String unlocalizedName;
79
80
    public static int getIdFromItem(Item itemIn)
81
    {
82
        return itemIn == null ? 0 : itemRegistry.getIDForObject(itemIn);
83
    }
84
85
    public static Item getItemById(int id)
86
    {
87
        return (Item)itemRegistry.getObjectById(id);
88
    }
89
90
    public static Item getItemFromBlock(Block blockIn)
91
    {
92
        return (Item)BLOCK_TO_ITEM.get(blockIn);
93
    }
94
95
    /**
96
     * Tries to get an Item by it's name (e.g. minecraft:apple) or a String representation of a numerical ID. If both
97
     * fail, null is returned.
98
     */
99
    public static Item getByNameOrId(String id)
100
    {
101
        Item item = (Item)itemRegistry.getObject(new ResourceLocation(id));
102
103
        if (item == null)
104
        {
105
            try
106
            {
107
                return getItemById(Integer.parseInt(id));
108
            }
109
            catch (NumberFormatException var3)
110
            {
111
                ;
112
            }
113
        }
114
115
        return item;
116
    }
117
118
    /**
119
     * Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data
120
     */
121
    public boolean updateItemStackNBT(NBTTagCompound nbt)
122
    {
123
        return false;
124
    }
125
126
    public Item setMaxStackSize(int maxStackSize)
127
    {
128
        this.maxStackSize = maxStackSize;
129
        return this;
130
    }
131
132
    /**
133
     * Called when a Block is right-clicked with this Item
134
     */
135
    public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
136
    {
137
        return false;
138
    }
139
140
    public float getStrVsBlock(ItemStack stack, Block state)
141
    {
142
        return 1.0F;
143
    }
144
145
    /**
146
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
147
     */
148
    public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
149
    {
150
        return itemStackIn;
151
    }
152
153
    /**
154
     * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
155
     * the Item before the action is complete.
156
     */
157
    public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
158
    {
159
        return stack;
160
    }
161
162
    /**
163
     * Returns the maximum size of the stack for a specific item. *Isn't this more a Set than a Get?*
164
     */
165
    public int getItemStackLimit()
166
    {
167
        return this.maxStackSize;
168
    }
169
170
    /**
171
     * Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is
172
     * placed as a Block (mostly used with ItemBlocks).
173
     */
174
    public int getMetadata(int damage)
175
    {
176
        return 0;
177
    }
178
179
    public boolean getHasSubtypes()
180
    {
181
        return this.hasSubtypes;
182
    }
183
184
    protected Item setHasSubtypes(boolean hasSubtypes)
185
    {
186
        this.hasSubtypes = hasSubtypes;
187
        return this;
188
    }
189
190
    /**
191
     * Returns the maximum damage an item can take.
192
     */
193
    public int getMaxDamage()
194
    {
195
        return this.maxDamage;
196
    }
197
198
    /**
199
     * set max damage of an Item
200
     */
201
    protected Item setMaxDamage(int maxDamageIn)
202
    {
203
        this.maxDamage = maxDamageIn;
204
        return this;
205
    }
206
207
    public boolean isDamageable()
208
    {
209
        return this.maxDamage > 0 && !this.hasSubtypes;
210
    }
211
212
    /**
213
     * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
214
     * the damage on the stack.
215
     */
216
    public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
217
    {
218
        return false;
219
    }
220
221
    /**
222
     * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
223
     */
224
    public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn)
225
    {
226
        return false;
227
    }
228
229
    /**
230
     * Check whether this Item can harvest the given Block
231
     */
232
    public boolean canHarvestBlock(Block blockIn)
233
    {
234
        return false;
235
    }
236
237
    /**
238
     * Returns true if the item can be used on the given entity, e.g. shears on sheep.
239
     */
240
    public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
241
    {
242
        return false;
243
    }
244
245
    /**
246
     * Sets bFull3D to True and return the object.
247
     */
248
    public Item setFull3D()
249
    {
250
        this.bFull3D = true;
251
        return this;
252
    }
253
254
    /**
255
     * Returns True is the item is renderer in full 3D when hold.
256
     */
257
    public boolean isFull3D()
258
    {
259
        return this.bFull3D;
260
    }
261
262
    /**
263
     * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
264
     * hands.
265
     */
266
    public boolean shouldRotateAroundWhenRendering()
267
    {
268
        return false;
269
    }
270
271
    /**
272
     * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item."
273
     */
274
    public Item setUnlocalizedName(String unlocalizedName)
275
    {
276
        this.unlocalizedName = unlocalizedName;
277
        return this;
278
    }
279
280
    /**
281
     * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the
282
     * unlocalized name itself is returned.
283
     */
284
    public String getUnlocalizedNameInefficiently(ItemStack stack)
285
    {
286
        String s = this.getUnlocalizedName(stack);
287
        return s == null ? "" : StatCollector.translateToLocal(s);
288
    }
289
290
    /**
291
     * Returns the unlocalized name of this item.
292
     */
293
    public String getUnlocalizedName()
294
    {
295
        return "item." + this.unlocalizedName;
296
    }
297
298
    /**
299
     * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
300
     * different names based on their damage or NBT.
301
     */
302
    public String getUnlocalizedName(ItemStack stack)
303
    {
304
        return "item." + this.unlocalizedName;
305
    }
306
307
    public Item setContainerItem(Item containerItem)
308
    {
309
        this.containerItem = containerItem;
310
        return this;
311
    }
312
313
    /**
314
     * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
315
     */
316
    public boolean getShareTag()
317
    {
318
        return true;
319
    }
320
321
    public Item getContainerItem()
322
    {
323
        return this.containerItem;
324
    }
325
326
    /**
327
     * True if this Item has a container item (a.k.a. crafting result)
328
     */
329
    public boolean hasContainerItem()
330
    {
331
        return this.containerItem != null;
332
    }
333
334
    public int getColorFromItemStack(ItemStack stack, int renderPass)
335
    {
336
        return 16777215;
337
    }
338
339
    /**
340
     * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
341
     * update it's contents.
342
     */
343
    public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
344
    {
345
    }
346
347
    /**
348
     * Called when item is crafted/smelted. Used only by maps so far.
349
     */
350
    public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn)
351
    {
352
    }
353
354
    /**
355
     * false for all Items except sub-classes of ItemMapBase
356
     */
357
    public boolean isMap()
358
    {
359
        return false;
360
    }
361
362
    /**
363
     * returns the action that specifies what animation to play when the items is being used
364
     */
365
    public EnumAction getItemUseAction(ItemStack stack)
366
    {
367
        return EnumAction.NONE;
368
    }
369
370
    /**
371
     * How long it takes to use or consume an item
372
     */
373
    public int getMaxItemUseDuration(ItemStack stack)
374
    {
375
        return 0;
376
    }
377
378
    /**
379
     * Called when the player stops using an Item (stops holding the right mouse button).
380
     */
381
    public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft)
382
    {
383
    }
384
385
    /**
386
     * Sets the string representing this item's effect on a potion when used as an ingredient.
387
     */
388
    protected Item setPotionEffect(String potionEffect)
389
    {
390
        this.potionEffect = potionEffect;
391
        return this;
392
    }
393
394
    public String getPotionEffect(ItemStack stack)
395
    {
396
        return this.potionEffect;
397
    }
398
399
    public boolean isPotionIngredient(ItemStack stack)
400
    {
401
        return this.getPotionEffect(stack) != null;
402
    }
403
404
    /**
405
     * allows items to add custom lines of information to the mouseover description
406
     */
407
    public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
408
    {
409
    }
410
411
    public String getItemStackDisplayName(ItemStack stack)
412
    {
413
        return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
414
    }
415
416
    public boolean hasEffect(ItemStack stack)
417
    {
418
        return stack.isItemEnchanted();
419
    }
420
421
    /**
422
     * Return an item rarity from EnumRarity
423
     */
424
    public EnumRarity getRarity(ItemStack stack)
425
    {
426
        return stack.isItemEnchanted() ? EnumRarity.RARE : EnumRarity.COMMON;
427
    }
428
429
    /**
430
     * Checks isDamagable and if it cannot be stacked
431
     */
432
    public boolean isItemTool(ItemStack stack)
433
    {
434
        return this.getItemStackLimit() == 1 && this.isDamageable();
435
    }
436
437
    protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids)
438
    {
439
        float f = playerIn.rotationPitch;
440
        float f1 = playerIn.rotationYaw;
441
        double d0 = playerIn.posX;
442
        double d1 = playerIn.posY + (double)playerIn.getEyeHeight();
443
        double d2 = playerIn.posZ;
444
        Vec3 vec3 = new Vec3(d0, d1, d2);
445
        float f2 = MathHelper.cos(-f1 * 0.017453292F - (float)Math.PI);
446
        float f3 = MathHelper.sin(-f1 * 0.017453292F - (float)Math.PI);
447
        float f4 = -MathHelper.cos(-f * 0.017453292F);
448
        float f5 = MathHelper.sin(-f * 0.017453292F);
449
        float f6 = f3 * f4;
450
        float f7 = f2 * f4;
451
        double d3 = 5.0D;
452
        Vec3 vec31 = vec3.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3);
453
        return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false);
454
    }
455
456
    /**
457
     * Return the enchantability factor of the item, most of the time is based on material.
458
     */
459
    public int getItemEnchantability()
460
    {
461
        return 0;
462
    }
463
464
    /**
465
     * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
466
     */
467
    public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
468
    {
469
        subItems.add(new ItemStack(itemIn, 1, 0));
470
    }
471
472
    /**
473
     * gets the CreativeTab this item is displayed on
474
     */
475
    public CreativeTabs getCreativeTab()
476
    {
477
        return this.tabToDisplayOn;
478
    }
479
480
    /**
481
     * returns this;
482
     */
483
    public Item setCreativeTab(CreativeTabs tab)
484
    {
485
        this.tabToDisplayOn = tab;
486
        return this;
487
    }
488
489
    /**
490
     * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal)
491
     * when not in creative
492
     */
493
    public boolean canItemEditBlocks()
494
    {
495
        return false;
496
    }
497
498
    /**
499
     * Return whether this item is repairable in an anvil.
500
     */
501
    public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
502
    {
503
        return false;
504
    }
505
506
    public Multimap<String, AttributeModifier> getItemAttributeModifiers()
507
    {
508
        return HashMultimap.<String, AttributeModifier>create();
509
    }
510
511
    public static void registerItems()
512
    {
513
        registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function<ItemStack, String>()
514
        {
515
            public String apply(ItemStack p_apply_1_)
516
            {
517
                return BlockStone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
518
            }
519
        })).setUnlocalizedName("stone"));
520
        registerItemBlock(Blocks.grass, new ItemColored(Blocks.grass, false));
521
        registerItemBlock(Blocks.dirt, (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, new Function<ItemStack, String>()
522
        {
523
            public String apply(ItemStack p_apply_1_)
524
            {
525
                return BlockDirt.DirtType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
526
            }
527
        })).setUnlocalizedName("dirt"));
528
        registerItemBlock(Blocks.cobblestone);
529
        registerItemBlock(Blocks.planks, (new ItemMultiTexture(Blocks.planks, Blocks.planks, new Function<ItemStack, String>()
530
        {
531
            public String apply(ItemStack p_apply_1_)
532
            {
533
                return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
534
            }
535
        })).setUnlocalizedName("wood"));
536
        registerItemBlock(Blocks.sapling, (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, new Function<ItemStack, String>()
537
        {
538
            public String apply(ItemStack p_apply_1_)
539
            {
540
                return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
541
            }
542
        })).setUnlocalizedName("sapling"));
543
        registerItemBlock(Blocks.bedrock);
544
        registerItemBlock(Blocks.sand, (new ItemMultiTexture(Blocks.sand, Blocks.sand, new Function<ItemStack, String>()
545
        {
546
            public String apply(ItemStack p_apply_1_)
547
            {
548
                return BlockSand.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
549
            }
550
        })).setUnlocalizedName("sand"));
551
        registerItemBlock(Blocks.gravel);
552
        registerItemBlock(Blocks.gold_ore);
553
        registerItemBlock(Blocks.iron_ore);
554
        registerItemBlock(Blocks.coal_ore);
555
        registerItemBlock(Blocks.log, (new ItemMultiTexture(Blocks.log, Blocks.log, new Function<ItemStack, String>()
556
        {
557
            public String apply(ItemStack p_apply_1_)
558
            {
559
                return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
560
            }
561
        })).setUnlocalizedName("log"));
562
        registerItemBlock(Blocks.log2, (new ItemMultiTexture(Blocks.log2, Blocks.log2, new Function<ItemStack, String>()
563
        {
564
            public String apply(ItemStack p_apply_1_)
565
            {
566
                return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata() + 4).getUnlocalizedName();
567
            }
568
        })).setUnlocalizedName("log"));
569
        registerItemBlock(Blocks.leaves, (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves"));
570
        registerItemBlock(Blocks.leaves2, (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves"));
571
        registerItemBlock(Blocks.sponge, (new ItemMultiTexture(Blocks.sponge, Blocks.sponge, new Function<ItemStack, String>()
572
        {
573
            public String apply(ItemStack p_apply_1_)
574
            {
575
                return (p_apply_1_.getMetadata() & 1) == 1 ? "wet" : "dry";
576
            }
577
        })).setUnlocalizedName("sponge"));
578
        registerItemBlock(Blocks.glass);
579
        registerItemBlock(Blocks.lapis_ore);
580
        registerItemBlock(Blocks.lapis_block);
581
        registerItemBlock(Blocks.dispenser);
582
        registerItemBlock(Blocks.sandstone, (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, new Function<ItemStack, String>()
583
        {
584
            public String apply(ItemStack p_apply_1_)
585
            {
586
                return BlockSandStone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
587
            }
588
        })).setUnlocalizedName("sandStone"));
589
        registerItemBlock(Blocks.noteblock);
590
        registerItemBlock(Blocks.golden_rail);
591
        registerItemBlock(Blocks.detector_rail);
592
        registerItemBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston));
593
        registerItemBlock(Blocks.web);
594
        registerItemBlock(Blocks.tallgrass, (new ItemColored(Blocks.tallgrass, true)).setSubtypeNames(new String[] {"shrub", "grass", "fern"}));
595
        registerItemBlock(Blocks.deadbush);
596
        registerItemBlock(Blocks.piston, new ItemPiston(Blocks.piston));
597
        registerItemBlock(Blocks.wool, (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth"));
598
        registerItemBlock(Blocks.yellow_flower, (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, new Function<ItemStack, String>()
599
        {
600
            public String apply(ItemStack p_apply_1_)
601
            {
602
                return BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.YELLOW, p_apply_1_.getMetadata()).getUnlocalizedName();
603
            }
604
        })).setUnlocalizedName("flower"));
605
        registerItemBlock(Blocks.red_flower, (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, new Function<ItemStack, String>()
606
        {
607
            public String apply(ItemStack p_apply_1_)
608
            {
609
                return BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.RED, p_apply_1_.getMetadata()).getUnlocalizedName();
610
            }
611
        })).setUnlocalizedName("rose"));
612
        registerItemBlock(Blocks.brown_mushroom);
613
        registerItemBlock(Blocks.red_mushroom);
614
        registerItemBlock(Blocks.gold_block);
615
        registerItemBlock(Blocks.iron_block);
616
        registerItemBlock(Blocks.stone_slab, (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab)).setUnlocalizedName("stoneSlab"));
617
        registerItemBlock(Blocks.brick_block);
618
        registerItemBlock(Blocks.tnt);
619
        registerItemBlock(Blocks.bookshelf);
620
        registerItemBlock(Blocks.mossy_cobblestone);
621
        registerItemBlock(Blocks.obsidian);
622
        registerItemBlock(Blocks.torch);
623
        registerItemBlock(Blocks.mob_spawner);
624
        registerItemBlock(Blocks.oak_stairs);
625
        registerItemBlock(Blocks.chest);
626
        registerItemBlock(Blocks.diamond_ore);
627
        registerItemBlock(Blocks.diamond_block);
628
        registerItemBlock(Blocks.crafting_table);
629
        registerItemBlock(Blocks.farmland);
630
        registerItemBlock(Blocks.furnace);
631
        registerItemBlock(Blocks.lit_furnace);
632
        registerItemBlock(Blocks.ladder);
633
        registerItemBlock(Blocks.rail);
634
        registerItemBlock(Blocks.stone_stairs);
635
        registerItemBlock(Blocks.lever);
636
        registerItemBlock(Blocks.stone_pressure_plate);
637
        registerItemBlock(Blocks.wooden_pressure_plate);
638
        registerItemBlock(Blocks.redstone_ore);
639
        registerItemBlock(Blocks.redstone_torch);
640
        registerItemBlock(Blocks.stone_button);
641
        registerItemBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer));
642
        registerItemBlock(Blocks.ice);
643
        registerItemBlock(Blocks.snow);
644
        registerItemBlock(Blocks.cactus);
645
        registerItemBlock(Blocks.clay);
646
        registerItemBlock(Blocks.jukebox);
647
        registerItemBlock(Blocks.oak_fence);
648
        registerItemBlock(Blocks.spruce_fence);
649
        registerItemBlock(Blocks.birch_fence);
650
        registerItemBlock(Blocks.jungle_fence);
651
        registerItemBlock(Blocks.dark_oak_fence);
652
        registerItemBlock(Blocks.acacia_fence);
653
        registerItemBlock(Blocks.pumpkin);
654
        registerItemBlock(Blocks.netherrack);
655
        registerItemBlock(Blocks.soul_sand);
656
        registerItemBlock(Blocks.glowstone);
657
        registerItemBlock(Blocks.lit_pumpkin);
658
        registerItemBlock(Blocks.trapdoor);
659
        registerItemBlock(Blocks.monster_egg, (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, new Function<ItemStack, String>()
660
        {
661
            public String apply(ItemStack p_apply_1_)
662
            {
663
                return BlockSilverfish.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
664
            }
665
        })).setUnlocalizedName("monsterStoneEgg"));
666
        registerItemBlock(Blocks.stonebrick, (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, new Function<ItemStack, String>()
667
        {
668
            public String apply(ItemStack p_apply_1_)
669
            {
670
                return BlockStoneBrick.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
671
            }
672
        })).setUnlocalizedName("stonebricksmooth"));
673
        registerItemBlock(Blocks.brown_mushroom_block);
674
        registerItemBlock(Blocks.red_mushroom_block);
675
        registerItemBlock(Blocks.iron_bars);
676
        registerItemBlock(Blocks.glass_pane);
677
        registerItemBlock(Blocks.melon_block);
678
        registerItemBlock(Blocks.vine, new ItemColored(Blocks.vine, false));
679
        registerItemBlock(Blocks.oak_fence_gate);
680
        registerItemBlock(Blocks.spruce_fence_gate);
681
        registerItemBlock(Blocks.birch_fence_gate);
682
        registerItemBlock(Blocks.jungle_fence_gate);
683
        registerItemBlock(Blocks.dark_oak_fence_gate);
684
        registerItemBlock(Blocks.acacia_fence_gate);
685
        registerItemBlock(Blocks.brick_stairs);
686
        registerItemBlock(Blocks.stone_brick_stairs);
687
        registerItemBlock(Blocks.mycelium);
688
        registerItemBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily));
689
        registerItemBlock(Blocks.nether_brick);
690
        registerItemBlock(Blocks.nether_brick_fence);
691
        registerItemBlock(Blocks.nether_brick_stairs);
692
        registerItemBlock(Blocks.enchanting_table);
693
        registerItemBlock(Blocks.end_portal_frame);
694
        registerItemBlock(Blocks.end_stone);
695
        registerItemBlock(Blocks.dragon_egg);
696
        registerItemBlock(Blocks.redstone_lamp);
697
        registerItemBlock(Blocks.wooden_slab, (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab)).setUnlocalizedName("woodSlab"));
698
        registerItemBlock(Blocks.sandstone_stairs);
699
        registerItemBlock(Blocks.emerald_ore);
700
        registerItemBlock(Blocks.ender_chest);
701
        registerItemBlock(Blocks.tripwire_hook);
702
        registerItemBlock(Blocks.emerald_block);
703
        registerItemBlock(Blocks.spruce_stairs);
704
        registerItemBlock(Blocks.birch_stairs);
705
        registerItemBlock(Blocks.jungle_stairs);
706
        registerItemBlock(Blocks.command_block);
707
        registerItemBlock(Blocks.beacon);
708
        registerItemBlock(Blocks.cobblestone_wall, (new ItemMultiTexture(Blocks.cobblestone_wall, Blocks.cobblestone_wall, new Function<ItemStack, String>()
709
        {
710
            public String apply(ItemStack p_apply_1_)
711
            {
712
                return BlockWall.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
713
            }
714
        })).setUnlocalizedName("cobbleWall"));
715
        registerItemBlock(Blocks.wooden_button);
716
        registerItemBlock(Blocks.anvil, (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil"));
717
        registerItemBlock(Blocks.trapped_chest);
718
        registerItemBlock(Blocks.light_weighted_pressure_plate);
719
        registerItemBlock(Blocks.heavy_weighted_pressure_plate);
720
        registerItemBlock(Blocks.daylight_detector);
721
        registerItemBlock(Blocks.redstone_block);
722
        registerItemBlock(Blocks.quartz_ore);
723
        registerItemBlock(Blocks.hopper);
724
        registerItemBlock(Blocks.quartz_block, (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, new String[] {"default", "chiseled", "lines"})).setUnlocalizedName("quartzBlock"));
725
        registerItemBlock(Blocks.quartz_stairs);
726
        registerItemBlock(Blocks.activator_rail);
727
        registerItemBlock(Blocks.dropper);
728
        registerItemBlock(Blocks.stained_hardened_clay, (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained"));
729
        registerItemBlock(Blocks.barrier);
730
        registerItemBlock(Blocks.iron_trapdoor);
731
        registerItemBlock(Blocks.hay_block);
732
        registerItemBlock(Blocks.carpet, (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet"));
733
        registerItemBlock(Blocks.hardened_clay);
734
        registerItemBlock(Blocks.coal_block);
735
        registerItemBlock(Blocks.packed_ice);
736
        registerItemBlock(Blocks.acacia_stairs);
737
        registerItemBlock(Blocks.dark_oak_stairs);
738
        registerItemBlock(Blocks.slime_block);
739
        registerItemBlock(Blocks.double_plant, (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, new Function<ItemStack, String>()
740
        {
741
            public String apply(ItemStack p_apply_1_)
742
            {
743
                return BlockDoublePlant.EnumPlantType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
744
            }
745
        })).setUnlocalizedName("doublePlant"));
746
        registerItemBlock(Blocks.stained_glass, (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass"));
747
        registerItemBlock(Blocks.stained_glass_pane, (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane"));
748
        registerItemBlock(Blocks.prismarine, (new ItemMultiTexture(Blocks.prismarine, Blocks.prismarine, new Function<ItemStack, String>()
749
        {
750
            public String apply(ItemStack p_apply_1_)
751
            {
752
                return BlockPrismarine.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
753
            }
754
        })).setUnlocalizedName("prismarine"));
755
        registerItemBlock(Blocks.sea_lantern);
756
        registerItemBlock(Blocks.red_sandstone, (new ItemMultiTexture(Blocks.red_sandstone, Blocks.red_sandstone, new Function<ItemStack, String>()
757
        {
758
            public String apply(ItemStack p_apply_1_)
759
            {
760
                return BlockRedSandstone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
761
            }
762
        })).setUnlocalizedName("redSandStone"));
763
        registerItemBlock(Blocks.red_sandstone_stairs);
764
        registerItemBlock(Blocks.stone_slab2, (new ItemSlab(Blocks.stone_slab2, Blocks.stone_slab2, Blocks.double_stone_slab2)).setUnlocalizedName("stoneSlab2"));
765
        registerItem(256, "iron_shovel", (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron"));
766
        registerItem(257, "iron_pickaxe", (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron"));
767
        registerItem(258, "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron"));
768
        registerItem(259, "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel"));
769
        registerItem(260, "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple"));
770
        registerItem(261, "bow", (new ItemBow()).setUnlocalizedName("bow"));
771
        registerItem(262, "arrow", (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat));
772
        registerItem(263, "coal", (new ItemCoal()).setUnlocalizedName("coal"));
773
        registerItem(264, "diamond", (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials));
774
        registerItem(265, "iron_ingot", (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials));
775
        registerItem(266, "gold_ingot", (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials));
776
        registerItem(267, "iron_sword", (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron"));
777
        registerItem(268, "wooden_sword", (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood"));
778
        registerItem(269, "wooden_shovel", (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood"));
779
        registerItem(270, "wooden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood"));
780
        registerItem(271, "wooden_axe", (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood"));
781
        registerItem(272, "stone_sword", (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone"));
782
        registerItem(273, "stone_shovel", (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone"));
783
        registerItem(274, "stone_pickaxe", (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone"));
784
        registerItem(275, "stone_axe", (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone"));
785
        registerItem(276, "diamond_sword", (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond"));
786
        registerItem(277, "diamond_shovel", (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond"));
787
        registerItem(278, "diamond_pickaxe", (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond"));
788
        registerItem(279, "diamond_axe", (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond"));
789
        registerItem(280, "stick", (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials));
790
        registerItem(281, "bowl", (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials));
791
        registerItem(282, "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew"));
792
        registerItem(283, "golden_sword", (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold"));
793
        registerItem(284, "golden_shovel", (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold"));
794
        registerItem(285, "golden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold"));
795
        registerItem(286, "golden_axe", (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold"));
796
        registerItem(287, "string", (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials));
797
        registerItem(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials));
798
        registerItem(289, "gunpowder", (new Item()).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials));
799
        registerItem(290, "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood"));
800
        registerItem(291, "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone"));
801
        registerItem(292, "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron"));
802
        registerItem(293, "diamond_hoe", (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond"));
803
        registerItem(294, "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold"));
804
        registerItem(295, "wheat_seeds", (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds"));
805
        registerItem(296, "wheat", (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials));
806
        registerItem(297, "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread"));
807
        registerItem(298, "leather_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 0)).setUnlocalizedName("helmetCloth"));
808
        registerItem(299, "leather_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 1)).setUnlocalizedName("chestplateCloth"));
809
        registerItem(300, "leather_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 2)).setUnlocalizedName("leggingsCloth"));
810
        registerItem(301, "leather_boots", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 3)).setUnlocalizedName("bootsCloth"));
811
        registerItem(302, "chainmail_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain"));
812
        registerItem(303, "chainmail_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain"));
813
        registerItem(304, "chainmail_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain"));
814
        registerItem(305, "chainmail_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain"));
815
        registerItem(306, "iron_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron"));
816
        registerItem(307, "iron_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron"));
817
        registerItem(308, "iron_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron"));
818
        registerItem(309, "iron_boots", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron"));
819
        registerItem(310, "diamond_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond"));
820
        registerItem(311, "diamond_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond"));
821
        registerItem(312, "diamond_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond"));
822
        registerItem(313, "diamond_boots", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond"));
823
        registerItem(314, "golden_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold"));
824
        registerItem(315, "golden_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold"));
825
        registerItem(316, "golden_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold"));
826
        registerItem(317, "golden_boots", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold"));
827
        registerItem(318, "flint", (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials));
828
        registerItem(319, "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw"));
829
        registerItem(320, "cooked_porkchop", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked"));
830
        registerItem(321, "painting", (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting"));
831
        registerItem(322, "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold"));
832
        registerItem(323, "sign", (new ItemSign()).setUnlocalizedName("sign"));
833
        registerItem(324, "wooden_door", (new ItemDoor(Blocks.oak_door)).setUnlocalizedName("doorOak"));
834
        Item item = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16);
835
        registerItem(325, "bucket", item);
836
        registerItem(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(item));
837
        registerItem(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(item));
838
        registerItem(328, "minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.RIDEABLE)).setUnlocalizedName("minecart"));
839
        registerItem(329, "saddle", (new ItemSaddle()).setUnlocalizedName("saddle"));
840
        registerItem(330, "iron_door", (new ItemDoor(Blocks.iron_door)).setUnlocalizedName("doorIron"));
841
        registerItem(331, "redstone", (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect));
842
        registerItem(332, "snowball", (new ItemSnowball()).setUnlocalizedName("snowball"));
843
        registerItem(333, "boat", (new ItemBoat()).setUnlocalizedName("boat"));
844
        registerItem(334, "leather", (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials));
845
        registerItem(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(item));
846
        registerItem(336, "brick", (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials));
847
        registerItem(337, "clay_ball", (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials));
848
        registerItem(338, "reeds", (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials));
849
        registerItem(339, "paper", (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc));
850
        registerItem(340, "book", (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc));
851
        registerItem(341, "slime_ball", (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc));
852
        registerItem(342, "chest_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.CHEST)).setUnlocalizedName("minecartChest"));
853
        registerItem(343, "furnace_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.FURNACE)).setUnlocalizedName("minecartFurnace"));
854
        registerItem(344, "egg", (new ItemEgg()).setUnlocalizedName("egg"));
855
        registerItem(345, "compass", (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools));
856
        registerItem(346, "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod"));
857
        registerItem(347, "clock", (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools));
858
        registerItem(348, "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials));
859
        registerItem(349, "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setHasSubtypes(true));
860
        registerItem(350, "cooked_fish", (new ItemFishFood(true)).setUnlocalizedName("fish").setHasSubtypes(true));
861
        registerItem(351, "dye", (new ItemDye()).setUnlocalizedName("dyePowder"));
862
        registerItem(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc));
863
        registerItem(353, "sugar", (new Item()).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials));
864
        registerItem(354, "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood));
865
        registerItem(355, "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed"));
866
        registerItem(356, "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone));
867
        registerItem(357, "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie"));
868
        registerItem(358, "filled_map", (new ItemMap()).setUnlocalizedName("map"));
869
        registerItem(359, "shears", (new ItemShears()).setUnlocalizedName("shears"));
870
        registerItem(360, "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon"));
871
        registerItem(361, "pumpkin_seeds", (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin"));
872
        registerItem(362, "melon_seeds", (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon"));
873
        registerItem(363, "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw"));
874
        registerItem(364, "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked"));
875
        registerItem(365, "chicken", (new ItemFood(2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw"));
876
        registerItem(366, "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked"));
877
        registerItem(367, "rotten_flesh", (new ItemFood(4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh"));
878
        registerItem(368, "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl"));
879
        registerItem(369, "blaze_rod", (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setFull3D());
880
        registerItem(370, "ghast_tear", (new Item()).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing));
881
        registerItem(371, "gold_nugget", (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials));
882
        registerItem(372, "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4"));
883
        registerItem(373, "potion", (new ItemPotion()).setUnlocalizedName("potion"));
884
        registerItem(374, "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle"));
885
        registerItem(375, "spider_eye", (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect));
886
        registerItem(376, "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing));
887
        registerItem(377, "blaze_powder", (new Item()).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing));
888
        registerItem(378, "magma_cream", (new Item()).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing));
889
        registerItem(379, "brewing_stand", (new ItemReed(Blocks.brewing_stand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing));
890
        registerItem(380, "cauldron", (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing));
891
        registerItem(381, "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder"));
892
        registerItem(382, "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing));
893
        registerItem(383, "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer"));
894
        registerItem(384, "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle"));
895
        registerItem(385, "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball"));
896
        registerItem(386, "writable_book", (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc));
897
        registerItem(387, "written_book", (new ItemEditableBook()).setUnlocalizedName("writtenBook").setMaxStackSize(16));
898
        registerItem(388, "emerald", (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials));
899
        registerItem(389, "item_frame", (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame"));
900
        registerItem(390, "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations));
901
        registerItem(391, "carrot", (new ItemSeedFood(3, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots"));
902
        registerItem(392, "potato", (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato"));
903
        registerItem(393, "baked_potato", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("potatoBaked"));
904
        registerItem(394, "poisonous_potato", (new ItemFood(2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous"));
905
        registerItem(395, "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap"));
906
        registerItem(396, "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setCreativeTab(CreativeTabs.tabBrewing));
907
        registerItem(397, "skull", (new ItemSkull()).setUnlocalizedName("skull"));
908
        registerItem(398, "carrot_on_a_stick", (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick"));
909
        registerItem(399, "nether_star", (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials));
910
        registerItem(400, "pumpkin_pie", (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood));
911
        registerItem(401, "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks"));
912
        registerItem(402, "firework_charge", (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc));
913
        registerItem(403, "enchanted_book", (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook"));
914
        registerItem(404, "comparator", (new ItemReed(Blocks.unpowered_comparator)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone));
915
        registerItem(405, "netherbrick", (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials));
916
        registerItem(406, "quartz", (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials));
917
        registerItem(407, "tnt_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.TNT)).setUnlocalizedName("minecartTnt"));
918
        registerItem(408, "hopper_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.HOPPER)).setUnlocalizedName("minecartHopper"));
919
        registerItem(409, "prismarine_shard", (new Item()).setUnlocalizedName("prismarineShard").setCreativeTab(CreativeTabs.tabMaterials));
920
        registerItem(410, "prismarine_crystals", (new Item()).setUnlocalizedName("prismarineCrystals").setCreativeTab(CreativeTabs.tabMaterials));
921
        registerItem(411, "rabbit", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("rabbitRaw"));
922
        registerItem(412, "cooked_rabbit", (new ItemFood(5, 0.6F, true)).setUnlocalizedName("rabbitCooked"));
923
        registerItem(413, "rabbit_stew", (new ItemSoup(10)).setUnlocalizedName("rabbitStew"));
924
        registerItem(414, "rabbit_foot", (new Item()).setUnlocalizedName("rabbitFoot").setPotionEffect(PotionHelper.rabbitFootEffect).setCreativeTab(CreativeTabs.tabBrewing));
925
        registerItem(415, "rabbit_hide", (new Item()).setUnlocalizedName("rabbitHide").setCreativeTab(CreativeTabs.tabMaterials));
926
        registerItem(416, "armor_stand", (new ItemArmorStand()).setUnlocalizedName("armorStand").setMaxStackSize(16));
927
        registerItem(417, "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc));
928
        registerItem(418, "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc));
929
        registerItem(419, "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc));
930
        registerItem(420, "lead", (new ItemLead()).setUnlocalizedName("leash"));
931
        registerItem(421, "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag"));
932
        registerItem(422, "command_block_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.COMMAND_BLOCK)).setUnlocalizedName("minecartCommandBlock").setCreativeTab((CreativeTabs)null));
933
        registerItem(423, "mutton", (new ItemFood(2, 0.3F, true)).setUnlocalizedName("muttonRaw"));
934
        registerItem(424, "cooked_mutton", (new ItemFood(6, 0.8F, true)).setUnlocalizedName("muttonCooked"));
935
        registerItem(425, "banner", (new ItemBanner()).setUnlocalizedName("banner"));
936
        registerItem(427, "spruce_door", (new ItemDoor(Blocks.spruce_door)).setUnlocalizedName("doorSpruce"));
937
        registerItem(428, "birch_door", (new ItemDoor(Blocks.birch_door)).setUnlocalizedName("doorBirch"));
938
        registerItem(429, "jungle_door", (new ItemDoor(Blocks.jungle_door)).setUnlocalizedName("doorJungle"));
939
        registerItem(430, "acacia_door", (new ItemDoor(Blocks.acacia_door)).setUnlocalizedName("doorAcacia"));
940
        registerItem(431, "dark_oak_door", (new ItemDoor(Blocks.dark_oak_door)).setUnlocalizedName("doorDarkOak"));
941
        registerItem(2256, "record_13", (new ItemRecord("13")).setUnlocalizedName("record"));
942
        registerItem(2257, "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record"));
943
        registerItem(2258, "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record"));
944
        registerItem(2259, "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record"));
945
        registerItem(2260, "record_far", (new ItemRecord("far")).setUnlocalizedName("record"));
946
        registerItem(2261, "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record"));
947
        registerItem(2262, "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record"));
948
        registerItem(2263, "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record"));
949
        registerItem(2264, "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record"));
950
        registerItem(2265, "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record"));
951
        registerItem(2266, "record_11", (new ItemRecord("11")).setUnlocalizedName("record"));
952
        registerItem(2267, "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record"));
953
    }
954
955
    /**
956
     * Register a default ItemBlock for the given Block.
957
     */
958
    private static void registerItemBlock(Block blockIn)
959
    {
960
        registerItemBlock(blockIn, new ItemBlock(blockIn));
961
    }
962
963
    /**
964
     * Register the given Item as the ItemBlock for the given Block.
965
     */
966
    protected static void registerItemBlock(Block blockIn, Item itemIn)
967
    {
968
        registerItem(Block.getIdFromBlock(blockIn), (ResourceLocation)Block.blockRegistry.getNameForObject(blockIn), itemIn);
969
        BLOCK_TO_ITEM.put(blockIn, itemIn);
970
    }
971
972
    private static void registerItem(int id, String textualID, Item itemIn)
973
    {
974
        registerItem(id, new ResourceLocation(textualID), itemIn);
975
    }
976
977
    private static void registerItem(int id, ResourceLocation textualID, Item itemIn)
978
    {
979
        itemRegistry.register(id, textualID, itemIn);
980
    }
981
982
    public static enum ToolMaterial
983
    {
984
        WOOD(0, 59, 2.0F, 0.0F, 15),
985
        STONE(1, 131, 4.0F, 1.0F, 5),
986
        IRON(2, 250, 6.0F, 2.0F, 14),
987
        EMERALD(3, 1561, 8.0F, 3.0F, 10),
988
        GOLD(0, 32, 12.0F, 0.0F, 22);
989
990
        private final int harvestLevel;
991
        private final int maxUses;
992
        private final float efficiencyOnProperMaterial;
993
        private final float damageVsEntity;
994
        private final int enchantability;
995
996
        private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability)
997
        {
998
            this.harvestLevel = harvestLevel;
999
            this.maxUses = maxUses;
1000
            this.efficiencyOnProperMaterial = efficiency;
1001
            this.damageVsEntity = damageVsEntity;
1002
            this.enchantability = enchantability;
1003
        }
1004
1005
        public int getMaxUses()
1006
        {
1007
            return this.maxUses;
1008
        }
1009
1010
        public float getEfficiencyOnProperMaterial()
1011
        {
1012
            return this.efficiencyOnProperMaterial;
1013
        }
1014
1015
        public float getDamageVsEntity()
1016
        {
1017
            return this.damageVsEntity;
1018
        }
1019
1020
        public int getHarvestLevel()
1021
        {
1022
            return this.harvestLevel;
1023
        }
1024
1025
        public int getEnchantability()
1026
        {
1027
            return this.enchantability;
1028
        }
1029
1030
        public Item getRepairItem()
1031
        {
1032
            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))));
1033
        }
1034
    }
1035
}
1036

Deobfuscated MCP 1.8.9 source of Item from Marcelektro/MavenMCP-1.8.9 (net/minecraft/item/Item.java), stored verbatim.