BiomesOPlenty/src/minecraft/biomesoplenty/items/ItemBOPGlass.java

34 lines
719 B
Java
Raw Normal View History

package biomesoplenty.items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBOPGlass extends ItemBlock
{
private static final String[] glassTypes = new String[] {"celestialLens", "sacrificialfocus_empty", "sacrificialfocus_active", "sacrificialfocus_villager"};
public ItemBOPGlass(int par1)
{
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public int getMetadata(int meta)
{
return meta & 15;
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= glassTypes.length) {
meta = 0;
}
2013-06-09 00:39:12 +00:00
return super.getUnlocalizedName() + "." + glassTypes[meta];
}
}