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)
This commit is contained in:
Mathijs Riezebos 2017-05-03 11:51:14 +02:00
parent fa6d32cf0c
commit 9f303bc66b

View file

@ -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); DimDoors.proxy.updateDoorTE((BlockDimDoorBase) world.getBlockState(pos).getBlock(), world, pos);
} }
} else { } else {
try {
tileEntity.readFromNBT(tileEntityNBT); //this reads in the wrong blockPos 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.setPos(pos); //correct the position
tileEntity.markDirty(); tileEntity.markDirty();