ItemCoal .java

net.minecraft.item.ItemCoal (class, 33 lines): members: getSubItems, getUnlocalizedName. strings: "item.charcoal", "item.coal". imports: CreativeTabs.

net.minecraft.itemclass33 linescommonextends Item927 B

API Surface (2)

String getUnlocalizedName(ItemStack stack)
void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)

String literals (2)

"item.charcoal"
"item.coal"

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ItemCoal.java33 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.item;
2
3
import java.util.List;
4
import net.minecraft.creativetab.CreativeTabs;
5
6
public class ItemCoal extends Item
7
{
8
    public ItemCoal()
9
    {
10
        this.setHasSubtypes(true);
11
        this.setMaxDamage(0);
12
        this.setCreativeTab(CreativeTabs.tabMaterials);
13
    }
14
15
    /**
16
     * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
17
     * different names based on their damage or NBT.
18
     */
19
    public String getUnlocalizedName(ItemStack stack)
20
    {
21
        return stack.getMetadata() == 1 ? "item.charcoal" : "item.coal";
22
    }
23
24
    /**
25
     * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
26
     */
27
    public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
28
    {
29
        subItems.add(new ItemStack(itemIn, 1, 0));
30
        subItems.add(new ItemStack(itemIn, 1, 1));
31
    }
32
}
33

Deobfuscated MCP 1.8.9 source of ItemCoal from Marcelektro/MavenMCP-1.8.9 (net/minecraft/item/ItemCoal.java), stored verbatim.