From a91c5e8649811ad373f7feb294957649ec22da00 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Wed, 25 Jun 2014 10:05:05 +0300 Subject: [PATCH] Fix ghost facades from pre-6.0.x worlds Essentially same as #1905 --- common/buildcraft/transport/TileGenericPipe.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index 20b637c0..4faa03a0 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -174,8 +174,12 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui if (nbt.hasKey("facadeBlocks[" + i + "]")) { // 5.0.x Block block = (Block) Block.blockRegistry.getObjectById(nbt.getInteger("facadeBlocks[" + i + "]")); - int metadata = nbt.getInteger("facadeMeta[" + i + "]"); - pluggable = new ItemFacade.FacadePluggable(new ItemFacade.FacadeState[]{ItemFacade.FacadeState.create(block, metadata)}); + int blockId = nbt.getInteger("facadeBlocks[" + i + "]"); + + if (blockId != 0) { + int metadata = nbt.getInteger("facadeMeta[" + i + "]"); + pluggable = new ItemFacade.FacadePluggable(new ItemFacade.FacadeState[]{ItemFacade.FacadeState.create(block, metadata)}); + } } else if (nbt.hasKey("facadeBlocksStr[" + i + "][0]")) { // 6.0.x ItemFacade.FacadeState mainState = ItemFacade.FacadeState.create(