Class GenerationTask
java.lang.Object
net.neoforged.neoforge.server.command.generation.GenerationTask
Special thanks to Jasmine and Gegy for allowing us to use their pregenerator mod as a model to use in NeoForge!
Original code: https://github.com/jaskarth/fabric-chunkpregenerator
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final ServerChunkCache
private static final int
private final AtomicInteger
private GenerationTask.Listener
private static final org.apache.logging.log4j.Logger
static final TicketType
<ChunkPos> private final AtomicInteger
private static final int
private final AtomicInteger
private final Object
private final int
private final MinecraftServer
private final ServerLevel
private final AtomicInteger
private boolean
private final int
private final int
private final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
acceptChunkResult
(long chunk, ChunkResult<ChunkAccess> result) private void
acquireChunk
(long chunk) private it.unimi.dsi.fastutil.longs.LongList
collectChunks
(int count) private void
enqueueChunks
(it.unimi.dsi.fastutil.longs.LongList chunks) int
int
int
int
private boolean
isChunkFullyGenerated
(ChunkPos chunkPosInLocalSpace) private void
releaseChunk
(long chunk) void
run
(GenerationTask.Listener listener) void
stop()
private void
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
BATCH_SIZE
private static final int BATCH_SIZE- See Also:
-
QUEUE_THRESHOLD
private static final int QUEUE_THRESHOLD- See Also:
-
COARSE_CELL_SIZE
private static final int COARSE_CELL_SIZE- See Also:
-
server
-
chunkSource
-
serverLevel
-
iterator
-
x
private final int x -
z
private final int z -
radius
private final int radius -
totalCount
private final int totalCount -
queueLock
-
queuedCount
-
okCount
-
errorCount
-
skippedCount
-
listener
-
stopped
private volatile boolean stopped -
NEOFORGE_GENERATE_FORCED
-
-
Constructor Details
-
GenerationTask
-
-
Method Details
-
getOkCount
public int getOkCount() -
getErrorCount
public int getErrorCount() -
getSkippedCount
public int getSkippedCount() -
getTotalCount
public int getTotalCount() -
run
-
stop
public void stop() -
tryEnqueueTasks
private void tryEnqueueTasks() -
enqueueChunks
private void enqueueChunks(it.unimi.dsi.fastutil.longs.LongList chunks) -
acceptChunkResult
-
collectChunks
private it.unimi.dsi.fastutil.longs.LongList collectChunks(int count) -
acquireChunk
private void acquireChunk(long chunk) -
releaseChunk
private void releaseChunk(long chunk) -
isChunkFullyGenerated
-