Add config assumePreExistingChunksAreFinished

This commit is contained in:
James Seibel
2024-12-20 15:25:31 -06:00
parent 61a06c87c2
commit 3d866c480f
4 changed files with 26 additions and 2 deletions
@@ -1279,6 +1279,22 @@ public class Config
+ "")
.build();
public static ConfigEntry<Boolean> assumePreExistingChunksAreFinished = new ConfigEntry.Builder<Boolean>()
.set(false)
.comment(""
+ "When DH pulls in pre-existing chunks it will attempt to \n"
+ "run any missing world generation steps; for example: \n"
+ "if a chunk has the status SURFACE, DH will skip BIOMES \n"
+ "and SURFACE, but will run FEATURES. \n"
+ " \n"
+ "However if for some reason the chunks are malformed \n"
+ "or there's some other issue that causes the status \n"
+ "to be incorrect that can either cause world gen \n"
+ "lock-ups and/or crashes. \n"
+ "If either of those happen try setting this to True. \n"
+ "")
.build();
}
public static class MultiThreading
@@ -118,7 +118,10 @@ public class BatchGenerator implements IDhApiWorldGenerator
Consumer<IChunkWrapper> consumerWrapper = (chunkWrapper) -> resultConsumer.accept(new Object[]{chunkWrapper});
try
{
return this.generationEnvironment.generateChunks(chunkPosMinX, chunkPosMinZ, generationRequestChunkWidthCount, targetStep, worldGeneratorThreadPool, consumerWrapper);
return this.generationEnvironment.generateChunks(
chunkPosMinX, chunkPosMinZ, generationRequestChunkWidthCount,
generatorMode, targetStep,
worldGeneratorThreadPool, consumerWrapper);
}
catch (Exception e)
{
@@ -19,6 +19,7 @@
package com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
@@ -38,7 +39,7 @@ public abstract class AbstractBatchGenerationEnvironmentWrapper
public abstract void stop();
public abstract CompletableFuture<Void> generateChunks(
int minX, int minZ, int genSize, EDhApiWorldGenerationStep targetStep,
int minX, int minZ, int genSize, EDhApiDistantGeneratorMode generatorMode, EDhApiWorldGenerationStep targetStep,
ExecutorService worldGeneratorThreadPool, Consumer<IChunkWrapper> resultConsumer);
}
@@ -565,6 +565,10 @@
"Pull Lighting For Pre-generated Chunks",
"distanthorizons.config.common.lodBuilding.pullLightingForPregeneratedChunks.@tooltip":
"If true LOD generation for pre-existing chunks will attempt to pull the lighting data \nsaved in Minecraft's Region files. \nIf false DH will pull in chunks without lighting and re-light them. \n\nSetting this to true will result in faster LOD generation \nfor already generated worlds, but is broken by most lighting mods. \n\nSet this to false if LODs are black.",
"distanthorizons.config.common.lodBuilding.assumePreExistingChunksAreFinished":
"Assume Pre-Existing Chunks Are Finished",
"distanthorizons.config.common.lodBuilding.assumePreExistingChunksAreFinished.@tooltip":
"Setting this to true may solve some issues when using DH with a pre-generated world.",
"distanthorizons.config.common.lodBuilding.dataCompression":
"Data Compression",
"distanthorizons.config.common.lodBuilding.dataCompression.@tooltip":