diff --git a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java index 12ca6fed4..2c6ebacf5 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java @@ -44,6 +44,7 @@ import biomesoplenty.blocks.BlockWillow; import biomesoplenty.items.ItemBOPAmethyst; import biomesoplenty.items.ItemBOPAppleLeaves; import biomesoplenty.items.ItemBOPBamboo; +import biomesoplenty.items.ItemBOPBones; import biomesoplenty.items.ItemBOPColorizedLeaves; import biomesoplenty.items.ItemBOPColorizedSapling; import biomesoplenty.items.ItemBOPFlower; @@ -223,7 +224,7 @@ public class BOPBlocks { // GameRegistry.registerBlock(Blocks.amethyst.get(), ItemBOPAmethyst.class, "amethystOre1"); GameRegistry.registerBlock(Blocks.cloud.get(), "cloud"); - GameRegistry.registerBlock(Blocks.bones.get(), "bones"); + GameRegistry.registerBlock(Blocks.bones.get(), ItemBOPBones.class, "bones"); ItemBOPSlab.setSlabs(Blocks.stoneSingleSlab.get(), Blocks.stoneDoubleSlab.get()); GameRegistry.registerBlock(Blocks.stoneDoubleSlab.get(), ItemBOPSlab.class, "stoneDoubleSlab"); diff --git a/src/minecraft/biomesoplenty/items/ItemBOPBones.java b/src/minecraft/biomesoplenty/items/ItemBOPBones.java new file mode 100644 index 000000000..66cc03c4c --- /dev/null +++ b/src/minecraft/biomesoplenty/items/ItemBOPBones.java @@ -0,0 +1,31 @@ +package biomesoplenty.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBOPBones extends ItemBlock +{ + private static final String[] types = new String[] {"bones_small", "bones_medium", "bones_large"}; + + public ItemBOPBones(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 >= types.length) + meta = 0; + + return types[meta]; + } +}