Fixed Bone Segment naming

This commit is contained in:
Adubbz 2013-05-23 06:29:39 +10:00
parent d9b3519b65
commit d22edc35f3
2 changed files with 33 additions and 1 deletions

View file

@ -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");

View file

@ -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];
}
}