    001    package net.minecraft.item;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import net.minecraft.block.Block;
    006
    007    public class ItemMultiTextureTile extends ItemBlock
    008    {
    009        private final Block theBlock;
    010        private final String[] field_82804_b;
    011
    012        public ItemMultiTextureTile(int par1, Block par2Block, String[] par3ArrayOfStr)
    013        {
    014            super(par1);
    015            this.theBlock = par2Block;
    016            this.field_82804_b = par3ArrayOfStr;
    017            this.setMaxDamage(0);
    018            this.setHasSubtypes(true);
    019        }
    020
    021        @SideOnly(Side.CLIENT)
    022
    023        /**
    024         * Gets an icon index based on an item's damage value
    025         */
    026        public int getIconFromDamage(int par1)
    027        {
    028            return this.theBlock.getBlockTextureFromSideAndMetadata(2, par1);
    029        }
    030
    031        /**
    032         * Returns the metadata of the block which this Item (ItemBlock) can place
    033         */
    034        public int getMetadata(int par1)
    035        {
    036            return par1;
    037        }
    038
    039        public String getItemNameIS(ItemStack par1ItemStack)
    040        {
    041            int var2 = par1ItemStack.getItemDamage();
    042
    043            if (var2 < 0 || var2 >= this.field_82804_b.length)
    044            {
    045                var2 = 0;
    046            }
    047
    048            return super.getItemName() + "." + this.field_82804_b[var2];
    049        }
    050    }