public class ItemCoal extends Item
{
private Icon field_77705_m;
public ItemCoal(int par1)
{
super(par1);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal";
}
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(par1, 1, 0));
par3List.add(new ItemStack(par1, 1, 1));
}
/**
* Gets an icon index based on an item's damage value
*/
public Icon getIconFromDamage(int par1)
{
return par1 == 1 ? this.field_77705_m : super.getIconFromDamage(par1);
}