Files
TinkersConstruct/tconstruct/items/blocks/StainedGlassClearPaneItem.java
T
2013-08-07 19:06:26 -07:00

29 lines
893 B
Java

package tconstruct.items.blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class StainedGlassClearPaneItem extends ItemBlock
{
public static final String blockType[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
public StainedGlassClearPaneItem(int id)
{
super(id);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.stainedglass.").append(blockType[pos]).append(".pane").toString();
}
}