mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
37 lines
914 B
Java
37 lines
914 B
Java
package mods.tinker.tconstruct.items.blocks;
|
|
|
|
import java.util.List;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.item.ItemBlock;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.MathHelper;
|
|
|
|
public class GlassBlockItem extends ItemBlock
|
|
{
|
|
public static final String blockType[] =
|
|
{
|
|
"glass.pure", "glass.soul", "glass.soul.pure"
|
|
};
|
|
|
|
public GlassBlockItem(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.").append(blockType[pos]).toString();
|
|
}
|
|
}
|