From 85b3ab20254439eeb378e8e18bd97d6da62e438c Mon Sep 17 00:00:00 2001 From: Snownee <1850986885@qq.com> Date: Wed, 11 Nov 2020 01:48:42 +0800 Subject: [PATCH] Fix SchematicWorld NPE --- .../simibubi/create/content/schematics/SchematicWorld.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java index 0cb77977b..4aa3cdbe4 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java @@ -87,8 +87,10 @@ public class SchematicWorld extends WrappedWorld { BlockState blockState = getBlockState(pos); if (blockState.hasTileEntity()) { TileEntity tileEntity = blockState.createTileEntity(this); - tileEntity.setLocation(this, pos); - tileEntities.put(pos, tileEntity); + if (tileEntity != null) { + tileEntity.setLocation(this, pos); + tileEntities.put(pos, tileEntity); + } return tileEntity; } return null;