From 6c4e8021d646ba7b94d64c712a487a435597e5aa Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 19 May 2026 21:04:51 -0500 Subject: [PATCH] Fix DH world gen not priming CARVER heightmaps Fixes some world gen mods not having access to the necessary heightmaps --- .../BatchGenerationEnvironment.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index 01b7d919e..07aa6cda8 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -56,6 +56,7 @@ import java.util.concurrent.*; import java.util.function.Consumer; import com.seibel.distanthorizons.coreapi.ModInfo; +import net.minecraft.world.level.levelgen.Heightmap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -672,12 +673,16 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm return; } -// throwIfThreadInterrupted(); -// // caves can generally be ignored since they aren't generally visible from far away -// if (step == EDhApiWorldGenerationStep.CARVERS) -// { -// return; -// } + // carvers heightmaps are needed by some world gen mods, + // otherwise unexpected issues may occur + // (like trying to use an empty heightmap and walking out the bottom of + // the world looking for a valid snow location). + throwIfThreadInterrupted(); + for (ChunkWrapper chunkWrapper : chunkWrappersToGenerate) + { + ChunkAccess chunk = chunkWrapper.getChunk(); + Heightmap.primeHeightmaps(chunk, ChunkStatus.CARVERS.heightmapsAfter()); + } throwIfThreadInterrupted(); this.stepFeatures.generateGroup(genEvent.threadedParam, region, GetCutoutFrom(chunkWrappersToGenerate, EDhApiWorldGenerationStep.FEATURES));