From 94436584312b5fcb921c836fe6ff2a74d96faf1a Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 21 Oct 2021 18:47:38 +0200 Subject: [PATCH] Dummy beats null - Implement #2228 --- .../worldWrappers/DummyStatusListener.java | 18 ++++++++++++++++++ .../worldWrappers/WrappedServerWorld.java | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/simibubi/create/foundation/utility/worldWrappers/DummyStatusListener.java diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/DummyStatusListener.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/DummyStatusListener.java new file mode 100644 index 000000000..b963a236c --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/DummyStatusListener.java @@ -0,0 +1,18 @@ +package com.simibubi.create.foundation.utility.worldWrappers; + +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.chunk.ChunkStatus; +import net.minecraft.world.chunk.listener.IChunkStatusListener; + +public class DummyStatusListener implements IChunkStatusListener { + + @Override + public void updateSpawnPos(ChunkPos p_219509_1_) {} + + @Override + public void onStatusChange(ChunkPos p_219508_1_, ChunkStatus p_219508_2_) {} + + @Override + public void stop() {} + +} diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java index 6161cbfc4..8104de717 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java @@ -37,8 +37,10 @@ public class WrappedServerWorld extends ServerWorld { protected World world; public WrappedServerWorld(World world) { - // Replace null with world.getChunkProvider().chunkManager.progressListener ? We had null in 1.15 - super(world.getServer(), Util.backgroundExecutor(), getLevelSaveFromWorld(world), (IServerWorldInfo) world.getLevelData(), world.dimension(), world.dimensionType(), null, ((ServerChunkProvider) world.getChunkSource()).getGenerator(), world.isDebug(), world.getBiomeManager().biomeZoomSeed, Collections.EMPTY_LIST, false); //, world.field_25143); + super(world.getServer(), Util.backgroundExecutor(), getLevelSaveFromWorld(world), + (IServerWorldInfo) world.getLevelData(), world.dimension(), world.dimensionType(), + new DummyStatusListener(), ((ServerChunkProvider) world.getChunkSource()).getGenerator(), world.isDebug(), + world.getBiomeManager().biomeZoomSeed, Collections.emptyList(), false); this.world = world; }