ItemCloth .java

net.minecraft.item.ItemCloth (class, 32 lines): extends ItemBlock. members: getMetadata, getUnlocalizedName. imports: Block.

net.minecraft.itemclass32 linescommonextends ItemBlock870 B

API Surface (2)

int getMetadata(int damage)
String getUnlocalizedName(ItemStack stack)

Code Graph: Dependencies (3)

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

Full Source

ItemCloth.java32 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.item;
2
3
import net.minecraft.block.Block;
4
5
public class ItemCloth extends ItemBlock
6
{
7
    public ItemCloth(Block block)
8
    {
9
        super(block);
10
        this.setMaxDamage(0);
11
        this.setHasSubtypes(true);
12
    }
13
14
    /**
15
     * Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is
16
     * placed as a Block (mostly used with ItemBlocks).
17
     */
18
    public int getMetadata(int damage)
19
    {
20
        return damage;
21
    }
22
23
    /**
24
     * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
25
     * different names based on their damage or NBT.
26
     */
27
    public String getUnlocalizedName(ItemStack stack)
28
    {
29
        return super.getUnlocalizedName() + "." + EnumDyeColor.byMetadata(stack.getMetadata()).getUnlocalizedName();
30
    }
31
}
32

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