From 12d321491ea494c546a2cf3f44a99b7fe145d81a Mon Sep 17 00:00:00 2001 From: Prototik Date: Sat, 10 May 2014 13:25:20 +0800 Subject: [PATCH] Add fallback facade loading for support migration from 5.0.x --- common/buildcraft/transport/TileGenericPipe.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index 841fb0d8..ccf51bea 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -176,8 +176,18 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler, facadeBlocks[i][1] = null; } - facadeMeta[i][0] = nbt.getInteger("facadeMeta[" + i + "][0]"); - facadeMeta[i][1] = nbt.getInteger("facadeMeta[" + i + "][1]"); + if (nbt.hasKey("facadeBlocks[" + i + "]")) { + facadeBlocks[i][0] = (Block) Block.blockRegistry.getObjectById(nbt.getInteger("facadeBlocks[" + i + "]")); + facadeBlocks[i][1] = null; + } + + if (nbt.hasKey("facadeMeta[" + i + "]")) { + facadeMeta[i][0] = nbt.getInteger("facadeMeta[" + i + "]"); + facadeMeta[i][1] = 0; + } else { + facadeMeta[i][0] = nbt.getInteger("facadeMeta[" + i + "][0]"); + facadeMeta[i][1] = nbt.getInteger("facadeMeta[" + i + "][1]"); + } plugs[i] = nbt.getBoolean("plug[" + i + "]"); robotStations[i] = nbt.getBoolean("robotStation[" + i + "]");