Fix typos, merge WorldGenStep enum, and update Core

This commit is contained in:
James Seibel
2023-04-27 20:35:10 -05:00
parent e6273fa6a4
commit ef84fe97d5
4 changed files with 18 additions and 18 deletions
@@ -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)
{
@@ -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<ChunkAccess> 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<Void> generateChunks(int minX, int minZ, int genSize, EGenerationStep targetStep, double runTimeRatio, Consumer<IChunkWrapper> resultConsumer)
public CompletableFuture<Void> generateChunks(int minX, int minZ, int genSize, EDhApiWorldGenerationStep targetStep, double runTimeRatio, Consumer<IChunkWrapper> resultConsumer)
{
//System.out.println("GenerationEvent: "+genSize+"@"+minX+","+minZ+" "+targetStep);
@@ -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<IChunkWrapper> resultConsumer)
EDhApiWorldGenerationStep targetGenerationStep, double runTimeRatio, Consumer<IChunkWrapper> 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<IChunkWrapper> resultConsumer)
EDhApiWorldGenerationStep target, double runTimeRatio, Consumer<IChunkWrapper> resultConsumer)
{
if (size % 2 == 0)
{