mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
34 lines
910 B
Java
34 lines
910 B
Java
package tconstruct.items.blocks;
|
|
|
|
import net.minecraft.item.ItemBlock;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.MathHelper;
|
|
|
|
public class CraftingSlabItemBlock extends ItemBlock
|
|
{
|
|
public static final String blockType[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" };
|
|
|
|
public CraftingSlabItemBlock(int id)
|
|
{
|
|
super(id);
|
|
setMaxDamage(0);
|
|
setHasSubtypes(true);
|
|
}
|
|
|
|
public int getMetadata (int meta)
|
|
{
|
|
return meta;
|
|
}
|
|
|
|
@Override
|
|
public String getUnlocalizedName (ItemStack itemstack)
|
|
{
|
|
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
|
|
if (pos == 0 || pos == 5)
|
|
{
|
|
return blockType[pos];
|
|
}
|
|
return (new StringBuilder()).append("ToolStation.").append(blockType[pos]).toString();
|
|
}
|
|
}
|