From 7b326d63e898853aa3bd22efdf4cd84d1c03473a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 3 Feb 2026 07:41:20 -0600 Subject: [PATCH] feature world gen logging changes --- .../worldGeneration/step/StepFeatures.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java index 3ee9bfccb..936f99b4b 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepFeatures.java @@ -37,7 +37,10 @@ import net.minecraft.world.level.chunk.status.ChunkStatus; #endif import java.util.ArrayList; +import java.util.Collections; import java.util.ConcurrentModificationException; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; public final class StepFeatures extends AbstractWorldGenStep @@ -48,6 +51,8 @@ public final class StepFeatures extends AbstractWorldGenStep private final BatchGenerationEnvironment environment; + public static final Set LOGGED_ERRORS = Collections.newSetFromMap(new ConcurrentHashMap()); + //=============// @@ -94,15 +99,21 @@ public final class StepFeatures extends AbstractWorldGenStep Heightmap.primeHeightmaps(chunk, STATUS.heightmapsAfter()); } - catch (ConcurrentModificationException e) // ReportedException + catch (ConcurrentModificationException e) { - // TODO + String message = "Concurrency issue when generating features for chunk at pos ["+chunkWrapper.getChunkPos()+"], error: ["+e.getMessage()+"], this message will only be logged once. This issue cannot be resolved from DH's end."; + if (LOGGED_ERRORS.add(message)) + { + LOGGER.warn(message, e); + } } catch (Exception e) { - LOGGER.warn("Unexpected issue when generating features for chunk at pos ["+chunkWrapper.getChunkPos()+"], error: ["+e.getMessage()+"].", e); - // FIXME: Features concurrent modification issue. Something about cocobeans might just - // error out. For now just retry. + String message = "Unexpected issue when generating features for chunk at pos ["+chunkWrapper.getChunkPos()+"], error: ["+e.getMessage()+"]."; + if (LOGGED_ERRORS.add(message)) + { + LOGGER.warn(message, e); + } } } }