    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import java.util.List;
    006
    007    public class ItemCoal extends Item
    008    {
    009        public ItemCoal(int par1)
    010        {
    011            super(par1);
    012            this.setHasSubtypes(true);
    013            this.setMaxDamage(0);
    014            this.setCreativeTab(CreativeTabs.tabMaterials);
    015        }
    016
    017        public String getItemNameIS(ItemStack par1ItemStack)
    018        {
    019            return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal";
    020        }
    021
    022        @SideOnly(Side.CLIENT)
    023
    024        /**
    025         * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
    026         */
    027        public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
    028        {
    029            par3List.add(new ItemStack(par1, 1, 0));
    030            par3List.add(new ItemStack(par1, 1, 1));
    031        }
    032    }