From 3de68248de2e72e09d243908c906ce546ef84335 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 18 Jan 2023 07:52:16 -0600 Subject: [PATCH] Fix the world generator running slowly Thanks for finding the issue Leetom! --- .../lod/core/generation/WorldGenerationQueue.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java index 78603c166..a946e5f5d 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java @@ -440,9 +440,14 @@ public class WorldGenerationQueue implements Closeable return; } - this.removeOutdatedGroups(); - this.processLooseTasks(); - this.pollAndStartNext(targetPos); + + // generate terrain until the generator is asked to stop (if the while loop wasn't done the world generator wouldn't have enough tasks`) + while (!this.generator.isBusy()) + { + this.removeOutdatedGroups(); + this.processLooseTasks(); + this.pollAndStartNext(targetPos); + } } private void startTaskGroup(InProgressWorldGenTask task)