feature world gen logging changes

This commit is contained in:
James Seibel
2026-02-03 07:41:20 -06:00
parent 74f80ca2f5
commit 7b326d63e8
@@ -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<String> LOGGED_ERRORS = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
//=============//
@@ -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);
}
}
}
}