diff --git a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java index bd761d3ee..999d6f379 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java @@ -23,6 +23,8 @@ public interface IHiveRegistry { SNOW("Forestry:snow"), SWAMP("Forestry:swamp"); + public static final HiveType[] VALUES = values(); + HiveType(String name) { this.name = name; } diff --git a/src/main/java/forestry/core/items/ItemBlockForestry.java b/src/main/java/forestry/core/items/ItemBlockForestry.java index 5e1f0db54..baf1f308a 100644 --- a/src/main/java/forestry/core/items/ItemBlockForestry.java +++ b/src/main/java/forestry/core/items/ItemBlockForestry.java @@ -18,7 +18,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; - +import forestry.api.apiculture.hives.IHiveRegistry.HiveType; +import forestry.apiculture.blocks.BlockBeehives; import forestry.core.blocks.BlockBase; import forestry.core.tiles.TileForestry; import forestry.core.tiles.TileUtil; @@ -49,6 +50,10 @@ public class ItemBlockForestry extends ItemBlock { BlockBase blockBase = (BlockBase) block; int meta = itemstack.getMetadata(); return block.getUnlocalizedName() + "." + blockBase.getNameFromMeta(meta); + }else if(block instanceof BlockBeehives){ + BlockBeehives blockHives = (BlockBeehives) block; + int meta = itemstack.getMetadata(); + return block.getUnlocalizedName() + "." + HiveType.VALUES[meta - 1].getName(); } return block.getUnlocalizedName(); }