    001package net.minecraft.item;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.block.Block;
    006import net.minecraft.block.BlockCloth;
    007
    008public class ItemCloth extends ItemBlock
    009{
    010    public ItemCloth(int par1)
    011    {
    012        super(par1);
    013        this.setMaxDamage(0);
    014        this.setHasSubtypes(true);
    015    }
    016
    017    @SideOnly(Side.CLIENT)
    018
    019    /**
    020     * Gets an icon index based on an item's damage value
    021     */
    022    public int getIconFromDamage(int par1)
    023    {
    024        return Block.cloth.getBlockTextureFromSideAndMetadata(2, BlockCloth.getBlockFromDye(par1));
    025    }
    026
    027    /**
    028     * Returns the metadata of the block which this Item (ItemBlock) can place
    029     */
    030    public int getMetadata(int par1)
    031    {
    032        return par1;
    033    }
    034
    035    public String getItemNameIS(ItemStack par1ItemStack)
    036    {
    037        return super.getItemName() + "." + ItemDye.dyeColorNames[BlockCloth.getBlockFromDye(par1ItemStack.getItemDamage())];
    038    }
    039}