package net.minecraft.item; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockLeaves; import net.minecraft.util.IIcon; public class ItemLeaves extends ItemBlock { private final BlockLeaves field_150940_b; private static final String __OBFID = "CL_00000046"; public ItemLeaves(BlockLeaves p_i45344_1_) { super(p_i45344_1_); this.field_150940_b = p_i45344_1_; this.setMaxDurability(0); this.setHasSubtypes(true); } /** * Returns the metadata of the block which this Item (ItemBlock) can place */ public int getMetadata(int p_77647_1_) { return p_77647_1_ | 4; } /** * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have * different names based on their damage or NBT. */ public String getUnlocalizedName(ItemStack stack) { int i = stack.getMetadata(); if (i < 0 || i >= this.field_150940_b.func_150125_e().length) { i = 0; } return super.getUnlocalizedName() + "." + this.field_150940_b.func_150125_e()[i]; } /** * Gets an icon index based on an item's damage value */ @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { return this.field_150940_b.getIcon(0, p_77617_1_); } @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { return this.field_150940_b.getRenderColor(p_82790_1_.getMetadata()); } }