BiomesOPlenty/common/biomesoplenty/itemblocks/ItemBlockSkystone.java

33 lines
677 B
Java
Raw Normal View History

2013-07-03 07:51:39 +00:00
package biomesoplenty.itemblocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
2013-07-03 07:51:39 +00:00
public class ItemBlockSkystone extends ItemBlock
{
private static final String[] types = new String[] {"holystone", "holycobble", "holybrick", "holystonemossy"};
2013-07-03 07:51:39 +00:00
public ItemBlockSkystone(int par1)
2013-05-31 10:34:02 +00:00
{
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 >= types.length) {
meta = 0;
}
2013-06-09 00:39:12 +00:00
return super.getUnlocalizedName() + "." + types[meta];
2013-05-31 10:34:02 +00:00
}
}