From c235abbfa613a17b2e7c3dbc673bf2675fcde122 Mon Sep 17 00:00:00 2001 From: BONNe Date: Sat, 8 Apr 2023 00:39:27 +0300 Subject: [PATCH] Disable chunk generation on rengeneration (#2114) The SimpleWorldRegenerator generated world new chunks that were not generated before. It is not necessary, as regeneration should happen only on used chunks. --- .../bentobox/bentobox/nms/SimpleWorldRegenerator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/nms/SimpleWorldRegenerator.java b/src/main/java/world/bentobox/bentobox/nms/SimpleWorldRegenerator.java index e7142284b..f37efc192 100644 --- a/src/main/java/world/bentobox/bentobox/nms/SimpleWorldRegenerator.java +++ b/src/main/java/world/bentobox/bentobox/nms/SimpleWorldRegenerator.java @@ -66,7 +66,12 @@ public void run() { } final int x = chunkX; final int z = chunkZ; - newTasks.add(regenerateChunk(gm, di, world, x, z)); + + // Only process non-generated chunks + if (world.isChunkGenerated(x, z)) { + newTasks.add(regenerateChunk(gm, di, world, x, z)); + } + chunkZ++; if (chunkZ > di.getMaxZChunk()) { chunkZ = di.getMinZChunk();