Fix ghost facades from pre-6.0.x worlds

Essentially same as #1905
This commit is contained in:
Raul Tambre 2014-06-25 10:05:05 +03:00
parent dfc759de6c
commit a91c5e8649

View file

@ -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(