From ef84fe97d5735e7399d6cd4ebfafdb1c342205bc Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 27 Apr 2023 20:35:10 -0500 Subject: [PATCH] Fix typos, merge WorldGenStep enum, and update Core --- .../lod/common/wrappers/WrapperFactory.java | 4 ++-- .../BatchGenerationEnvironment.java | 22 +++++++++---------- .../worldGeneration/GenerationEvent.java | 8 +++---- coreSubProjects | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/WrapperFactory.java b/common/src/main/java/com/seibel/lod/common/wrappers/WrapperFactory.java index e773bc4b3..cfa12fa68 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/WrapperFactory.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/WrapperFactory.java @@ -29,7 +29,7 @@ import com.seibel.lod.core.wrapperInterfaces.IWrapperFactory; import com.seibel.lod.core.wrapperInterfaces.block.IBlockStateWrapper; import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper; import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper; -import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvionmentWrapper; +import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper; import com.seibel.lod.common.wrappers.worldGeneration.BatchGenerationEnvironment; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.chunk.ChunkAccess; @@ -49,7 +49,7 @@ public class WrapperFactory implements IWrapperFactory @Override - public AbstractBatchGenerationEnvionmentWrapper createBatchGenerator(IDhLevel targetLevel) + public AbstractBatchGenerationEnvironmentWrapper createBatchGenerator(IDhLevel targetLevel) { if (targetLevel instanceof IDhServerLevel) { diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index 8db05807c..5fc2adef8 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -33,7 +33,7 @@ import com.seibel.lod.core.util.LodUtil; import com.seibel.lod.core.util.gridList.ArrayGridList; import com.seibel.lod.core.util.objects.LodThreadFactory; import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper; -import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvionmentWrapper; +import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper; import java.util.ArrayList; import java.util.Arrays; @@ -88,7 +88,7 @@ Carver Step: 0.000009923s Feature Step: 0.389072425s Lod Generation: 0.269023348s */ -public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnvionmentWrapper +public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnvironmentWrapper { public static final ConfigBasedSpamLogger PREF_LOGGER = new ConfigBasedSpamLogger(LogManager.getLogger("LodWorldGen"), @@ -451,7 +451,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv } public void generateDirect(GenerationEvent genEvent, ArrayGridList chunksToGenerate, - EGenerationStep step, LightedWorldGenRegion region) + EDhApiWorldGenerationStep step, LightedWorldGenRegion region) { try { @@ -466,7 +466,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv } }); - if (step == EGenerationStep.Empty) + if (step == EDhApiWorldGenerationStep.EMPTY) { return; } @@ -474,7 +474,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.timer.nextEvent("structStart"); stepStructureStart.generateGroup(genEvent.threadedParam, region, chunksToGenerate); genEvent.refreshTimeout(); - if (step == EGenerationStep.StructureStart) + if (step == EDhApiWorldGenerationStep.STRUCTURE_START) { return; } @@ -482,7 +482,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.timer.nextEvent("structRef"); stepStructureReference.generateGroup(genEvent.threadedParam, region, chunksToGenerate); genEvent.refreshTimeout(); - if (step == EGenerationStep.StructureReference) + if (step == EDhApiWorldGenerationStep.STRUCTURE_REFERENCE) { return; } @@ -490,7 +490,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.timer.nextEvent("biome"); stepBiomes.generateGroup(genEvent.threadedParam, region, chunksToGenerate); genEvent.refreshTimeout(); - if (step == EGenerationStep.Biomes) + if (step == EDhApiWorldGenerationStep.BIOMES) { return; } @@ -498,7 +498,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.timer.nextEvent("noise"); stepNoise.generateGroup(genEvent.threadedParam, region, chunksToGenerate); genEvent.refreshTimeout(); - if (step == EGenerationStep.Noise) + if (step == EDhApiWorldGenerationStep.NOISE) { return; } @@ -506,13 +506,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.timer.nextEvent("surface"); stepSurface.generateGroup(genEvent.threadedParam, region, chunksToGenerate); genEvent.refreshTimeout(); - if (step == EGenerationStep.Surface) + if (step == EDhApiWorldGenerationStep.SURFACE) { return; } genEvent.timer.nextEvent("carver"); - if (step == EGenerationStep.Carvers) + if (step == EDhApiWorldGenerationStep.CARVERS) { return; } @@ -592,7 +592,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv } @Override - public CompletableFuture generateChunks(int minX, int minZ, int genSize, EGenerationStep targetStep, double runTimeRatio, Consumer resultConsumer) + public CompletableFuture generateChunks(int minX, int minZ, int genSize, EDhApiWorldGenerationStep targetStep, double runTimeRatio, Consumer resultConsumer) { //System.out.println("GenerationEvent: "+genSize+"@"+minX+","+minZ+" "+targetStep); diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java index 98b2eed03..2fa73cd4a 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java @@ -24,6 +24,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import com.seibel.lod.api.enums.worldGeneration.EDhApiWorldGenerationStep; import com.seibel.lod.core.util.objects.UncheckedInterruptedException; import com.seibel.lod.core.config.Config; import com.seibel.lod.api.enums.config.ELightGenerationMode; @@ -31,7 +32,6 @@ import com.seibel.lod.core.logging.DhLoggerBuilder; import com.seibel.lod.core.pos.DhChunkPos; import com.seibel.lod.core.util.objects.EventTimer; import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper; -import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvionmentWrapper.EGenerationStep; import org.apache.logging.log4j.Logger; @@ -44,7 +44,7 @@ public final class GenerationEvent final ThreadedParameters threadedParam; final DhChunkPos minPos; final int size; - final EGenerationStep targetGenerationStep; + final EDhApiWorldGenerationStep targetGenerationStep; final ELightGenerationMode lightMode; final double runTimeRatio; EventTimer timer = null; @@ -56,7 +56,7 @@ public final class GenerationEvent public GenerationEvent(DhChunkPos minPos, int size, BatchGenerationEnvironment generationGroup, - EGenerationStep targetGenerationStep, double runTimeRatio, Consumer resultConsumer) + EDhApiWorldGenerationStep targetGenerationStep, double runTimeRatio, Consumer resultConsumer) { this.inQueueTime = System.nanoTime(); this.id = generationFutureDebugIDs++; @@ -72,7 +72,7 @@ public final class GenerationEvent public static GenerationEvent startEvent(DhChunkPos minPos, int size, BatchGenerationEnvironment generationGroup, - EGenerationStep target, double runTimeRatio, Consumer resultConsumer) + EDhApiWorldGenerationStep target, double runTimeRatio, Consumer resultConsumer) { if (size % 2 == 0) { diff --git a/coreSubProjects b/coreSubProjects index eb5da6fa4..64a1120be 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit eb5da6fa4ddf34b8dedf9f6a9a4f8e25087423a7 +Subproject commit 64a1120be2bfc4dae08e6c1cb7f8eba18df06ca7