From 1fd6b4360c44316e1255f2d7451062d6390eb4cc Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 3 Apr 2021 19:30:38 +0200 Subject: [PATCH] Performant fictional entities - Fixed crash with the Performant mod when entities are present in a ponder scene --- .../com/simibubi/create/content/schematics/SchematicWorld.java | 3 ++- .../foundation/utility/worldWrappers/WrappedChunkProvider.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 674881351..70f99bc27 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.schematics; import com.simibubi.create.Create; +import com.simibubi.create.foundation.utility.worldWrappers.WrappedChunkProvider; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import net.minecraft.block.AbstractFurnaceBlock; import net.minecraft.block.Block; @@ -42,7 +43,7 @@ public class SchematicWorld extends WrappedWorld implements IServerWorld { } public SchematicWorld(BlockPos anchor, World original) { - super(original); + super(original, new WrappedChunkProvider()); this.blocks = new HashMap<>(); this.tileEntities = new HashMap<>(); this.bounds = new MutableBoundingBox(); diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java index 0b6b52854..bf26318dd 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java @@ -54,6 +54,9 @@ public class WrappedChunkProvider extends AbstractChunkProvider { public WrappedChunk getChunk(int x, int z) { long pos = ChunkPos.asLong(x, z); + + if (chunks == null) + return null; WrappedChunk chunk = chunks.get(pos);