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