    001package net.minecraft.item;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.util.List;
    006import net.minecraft.creativetab.CreativeTabs;
    007
    008public 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}