diff --git a/src/main/java/de/johni0702/minecraft/bobby/FakeChunkManager.java b/src/main/java/de/johni0702/minecraft/bobby/FakeChunkManager.java index 1b06895..d040d31 100644 --- a/src/main/java/de/johni0702/minecraft/bobby/FakeChunkManager.java +++ b/src/main/java/de/johni0702/minecraft/bobby/FakeChunkManager.java @@ -192,7 +192,11 @@ public void update(BooleanSupplier shouldKeepTicking) { // Anything remaining in the set is no longer needed and can now be unloaded for (long chunkPos : toBeUnloaded) { unload(ChunkPos.getPackedX(chunkPos), ChunkPos.getPackedZ(chunkPos), false); + if (!shouldKeepTicking.getAsBoolean()) { + break; + } } + // Any jobs remaining in this set are no longer needed and can now be cancelled for (long chunkPos : toBeCancelled){ LoadingJob loadingJob = loadingJobs.remove(chunkPos);