From d62a0d440ce8253c0f93b262cbf90dc6a0c4ecdd Mon Sep 17 00:00:00 2001 From: Alex Binnie Date: Fri, 14 Jun 2013 17:09:11 +0100 Subject: [PATCH] Facades now store both block id and meta in nbt --- common/buildcraft/transport/ItemFacade.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java index f778b221..24176d58 100644 --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -138,10 +138,6 @@ public class ItemFacade extends ItemBuildCraft { } } - public static int encode(int blockId, int metaData) { - return metaData & 0xF | ((blockId & 0xFFF) << 4); - } - public static int getMetaData(ItemStack stack) { if(stack.hasTagCompound() && stack.getTagCompound().hasKey("meta")) return stack.getTagCompound().getInteger("meta"); @@ -149,6 +145,8 @@ public class ItemFacade extends ItemBuildCraft { } public static int getBlockId(ItemStack stack) { + if(stack.hasTagCompound() && stack.getTagCompound().hasKey("id")) + return stack.getTagCompound().getInteger("id"); return ((stack.getItemDamage() & 0xFFF0) >>> 4); } @@ -200,9 +198,10 @@ public class ItemFacade extends ItemBuildCraft { } public static ItemStack getStack(int blockID, int metadata) { - ItemStack stack = new ItemStack(BuildCraftTransport.facadeItem, 1, ItemFacade.encode(blockID, 0)); + ItemStack stack = new ItemStack(BuildCraftTransport.facadeItem, 1, 0); NBTTagCompound nbt = new NBTTagCompound("tag"); nbt.setInteger("meta", metadata); + nbt.setInteger("id", blockID); stack.setTagCompound(nbt); return stack; }