Move the world gen thread pool into the WorldGenQueue
We want Core to handle the world gen threads, not the individual world generators.
This commit is contained in:
-31
@@ -1,31 +0,0 @@
|
||||
package com.seibel.lod.api.interfaces.override;
|
||||
|
||||
import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
|
||||
import com.seibel.lod.api.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.enums.worldGeneration.EDhApiWorldGenThreadMode;
|
||||
import com.seibel.lod.api.interfaces.world.IDhApiChunkWrapper;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-9-8
|
||||
*/
|
||||
public abstract class AbstractDhApiWorldGenerator implements IDhApiOverrideable
|
||||
{
|
||||
/** Returns which thread chunk generation requests can be created on. */
|
||||
public abstract EDhApiWorldGenThreadMode getThreadingMode();
|
||||
|
||||
public EDhApiWorldGenThreadMode getCoreThreadingMode()
|
||||
{
|
||||
return this.getThreadingMode();
|
||||
}
|
||||
|
||||
public abstract IDhApiChunkWrapper generateChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiDistantGeneratorMode maxStepToGenerate);
|
||||
|
||||
public final IDhApiChunkWrapper generateCoreChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiDistantGeneratorMode maxStepToGenerate)
|
||||
{
|
||||
// TODO probably need to change the return type
|
||||
return null; //generateChunk(chunkPosX, chunkPosZ, null, generationStepEnumConverter.convertToApiType(maxStepToGenerate));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+3
-2
@@ -7,11 +7,12 @@ import com.seibel.lod.api.interfaces.override.IDhApiOverrideable;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-12-10
|
||||
* @version 2023-6-5
|
||||
*/
|
||||
public interface IDhApiWorldGenerator extends Closeable, IDhApiOverrideable
|
||||
{
|
||||
@@ -97,7 +98,7 @@ public interface IDhApiWorldGenerator extends Closeable, IDhApiOverrideable
|
||||
*/
|
||||
CompletableFuture<Void> generateChunks(int chunkPosMinX, int chunkPosMinZ,
|
||||
byte granularity, byte targetDataDetail, EDhApiDistantGeneratorMode generatorMode,
|
||||
Consumer<Object[]> resultConsumer) throws ClassCastException;
|
||||
ExecutorService worldGeneratorThreadPool, Consumer<Object[]> resultConsumer) throws ClassCastException;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user