From 38a4643cf3152dfec07b2e7556ca40d873adcf65 Mon Sep 17 00:00:00 2001 From: tom lee Date: Sun, 19 Dec 2021 22:03:15 +0800 Subject: [PATCH] WorldGen: Reversed priority for far vs near --- .../ExperimentalGenerator.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/ExperimentalGenerator.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/ExperimentalGenerator.java index c5c4aa1b8..c7c740351 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/ExperimentalGenerator.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/ExperimentalGenerator.java @@ -110,6 +110,26 @@ public class ExperimentalGenerator extends AbstractExperimentalWorldGeneratorWra for (int i = 0; i < maxIteration; i++) { + // We have nearPos to go though + if (i < nearCount && posToGenerate.getNthDetail(i, true) != 0) { + positionGoneThough++; + // TODO: Add comment here on why theres a '-1'. + // Not sure what's happening here. This is copied from previous codes. + byte detailLevel = (byte) (posToGenerate.getNthDetail(i, true) - 1); + int chunkX = LevelPosUtil.getChunkPos(detailLevel, posToGenerate.getNthPosX(i, true)); + int chunkZ = LevelPosUtil.getChunkPos(detailLevel, posToGenerate.getNthPosZ(i, true)); + if (checkIfPositionIsValid(chunkX, chunkZ)) { + ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ); + futuresChunkPos.add(chunkPos); + futures.add(executor.submit(() -> { + generationGroup.generateLodFromList(generationFutureDebugIDs++, chunkPos, generationGroupSize, + Steps.Features); + })); + toGenerate--; + } + } + if (toGenerate <= 0) + break; // We have farPos to go though if (i < farCount && posToGenerate.getNthDetail(i, false) != 0) { @@ -133,26 +153,6 @@ public class ExperimentalGenerator extends AbstractExperimentalWorldGeneratorWra break; - // We have nearPos to go though - if (i < nearCount && posToGenerate.getNthDetail(i, true) != 0) { - positionGoneThough++; - // TODO: Add comment here on why theres a '-1'. - // Not sure what's happening here. This is copied from previous codes. - byte detailLevel = (byte) (posToGenerate.getNthDetail(i, true) - 1); - int chunkX = LevelPosUtil.getChunkPos(detailLevel, posToGenerate.getNthPosX(i, true)); - int chunkZ = LevelPosUtil.getChunkPos(detailLevel, posToGenerate.getNthPosZ(i, true)); - if (checkIfPositionIsValid(chunkX, chunkZ)) { - ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ); - futuresChunkPos.add(chunkPos); - futures.add(executor.submit(() -> { - generationGroup.generateLodFromList(generationFutureDebugIDs++, chunkPos, generationGroupSize, - Steps.Features); - })); - toGenerate--; - } - } - if (toGenerate <= 0) - break; } if (targetToGenerate != toGenerate) {