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