From 9f303bc66bed5666fba26d8ae69697a8bae450d7 Mon Sep 17 00:00:00 2001 From: Mathijs Riezebos Date: Wed, 3 May 2017 11:51:14 +0200 Subject: [PATCH] More solid Schematic placement -Added Try- Catch block to prevent a TileEntity not getting loaded right from causing the Pocket from registering (which caused respective Schematic placements on the same position, which replaced unregistered Doors, to crash as well) --- .../java/com/zixiken/dimdoors/shared/PocketTemplate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zixiken/dimdoors/shared/PocketTemplate.java b/src/main/java/com/zixiken/dimdoors/shared/PocketTemplate.java index 789fbb18..a6bab82c 100644 --- a/src/main/java/com/zixiken/dimdoors/shared/PocketTemplate.java +++ b/src/main/java/com/zixiken/dimdoors/shared/PocketTemplate.java @@ -130,7 +130,11 @@ public class PocketTemplate { //there is exactly one pocket placer for each diff DimDoors.proxy.updateDoorTE((BlockDimDoorBase) world.getBlockState(pos).getBlock(), world, pos); } } else { - tileEntity.readFromNBT(tileEntityNBT); //this reads in the wrong blockPos + try { + tileEntity.readFromNBT(tileEntityNBT); //this reads in the wrong blockPos + } catch(Exception e) { + DimDoors.warn(this.getClass(), "Loading in the data for TileEntity of type " + tileEntity.toString() + " went wrong. Details: " + e.getLocalizedMessage()); + } } tileEntity.setPos(pos); //correct the position tileEntity.markDirty();