From 6ea864ef6b136a08862eb0131c61bcab47d52fbf Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 29 Nov 2025 09:59:33 -0600 Subject: [PATCH] TEST --- .../V2/FullDataUpdatePropagatorV2.java | 1 + .../core/generation/BatchGenerator.java | 4 ++-- .../core/generation/WorldGenerationQueue.java | 15 +++++++++------ .../core/util/threading/PriorityTaskPicker.java | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdatePropagatorV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdatePropagatorV2.java index 54363b73a..398fa7634 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdatePropagatorV2.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/V2/FullDataUpdatePropagatorV2.java @@ -82,6 +82,7 @@ public class FullDataUpdatePropagatorV2 implements IDebugRenderable, AutoCloseab } + //================// // parent updates // //================// diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java index 3afaf4559..9d5d365ac 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/BatchGenerator.java @@ -101,9 +101,9 @@ public class BatchGenerator implements IDhApiWorldGenerator EDhApiWorldGenerationStep targetStep = null; switch (generatorMode) { - case PRE_EXISTING_ONLY: // Only load in existing chunks. Note: this requires the biome generation step in order for biomes to be properly initialized. + case PRE_EXISTING_ONLY: // Only load in existing chunks. //case BIOME_ONLY: // No blocks. Require fake height in LodBuilder - targetStep = EDhApiWorldGenerationStep.BIOMES; + targetStep = EDhApiWorldGenerationStep.EMPTY; break; //case BIOME_ONLY_SIMULATE_HEIGHT: // targetStep = EDhApiWorldGenerationStep.NOISE; // Stone only. Requires a fake surface diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java index 83b5b2168..92b943b0f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/WorldGenerationQueue.java @@ -73,7 +73,7 @@ public class WorldGenerationQueue implements IFullDataSourceRetrievalQueue, IDeb * if this is too high it may cause issues when moving, * but if it is too low the generator threads won't have enough tasks to work on */ - private static final int MAX_QUEUED_TASKS_PER_THREAD = 3; + private static final int MAX_QUEUED_TASKS_PER_THREAD = 1; private final IDhApiWorldGenerator generator; @@ -412,12 +412,15 @@ public class WorldGenerationQueue implements IFullDataSourceRetrievalQueue, IDeb try { IChunkWrapper chunkWrapper = WRAPPER_FACTORY.createChunkWrapper(generatedObjectArray); + + //// TODO light data should be pulled (if possible) from the ChunkAccess object itself via ChunkFileReader.readLight + //// but this should work for now + //ArrayList nearbyChunkList = new ArrayList<>(); + //nearbyChunkList.add(chunkWrapper); + //byte maxSkyLight = this.level.getLevelWrapper().hasSkyLight() ? LodUtil.MAX_MC_LIGHT : LodUtil.MIN_MC_LIGHT; + //DhLightingEngine.INSTANCE.bakeChunkBlockLighting(chunkWrapper, nearbyChunkList, maxSkyLight); - // TODO light data should be pulled (if possible) from the ChunkAccess object itself via ChunkFileReader.readLight - // but this should work for now - ArrayList nearbyChunkList = new ArrayList(); - nearbyChunkList.add(chunkWrapper); - DhLightingEngine.INSTANCE.bakeChunkBlockLighting(chunkWrapper, nearbyChunkList, this.level.getLevelWrapper().hasSkyLight() ? LodUtil.MAX_MC_LIGHT : LodUtil.MIN_MC_LIGHT); + chunkWrapper.setIsDhBlockLightCorrect(true); try (FullDataSourceV2 dataSource = LodDataBuilder.createFromChunk(this.level.getLevelWrapper(), chunkWrapper)) { diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java b/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java index d312bea53..48b02bfaf 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java @@ -190,7 +190,7 @@ public class PriorityTaskPicker { return new RateLimitedThreadPoolExecutor( Config.Common.MultiThreading.numberOfThreads.get(), - new DhThreadFactory(this.name, Thread.MIN_PRIORITY, false), + new DhThreadFactory(this.name, 5, false), // TODO add config, just needs to be a couple higher than C2ME (default 4) for chunky to be mostly usable new ArrayBlockingQueue<>(Runtime.getRuntime().availableProcessors()) ); }