Class GenerationTask

java.lang.Object
net.neoforged.neoforge.server.command.generation.GenerationTask

public class GenerationTask extends Object
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
  • 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

      private final MinecraftServer server
    • chunkSource

      private final ServerChunkCache chunkSource
    • serverLevel

      private final ServerLevel serverLevel
    • iterator

      private final Iterator<ChunkPos> iterator
    • x

      private final int x
    • z

      private final int z
    • radius

      private final int radius
    • totalCount

      private final int totalCount
    • queueLock

      private final Object queueLock
    • queuedCount

      private final AtomicInteger queuedCount
    • okCount

      private final AtomicInteger okCount
    • errorCount

      private final AtomicInteger errorCount
    • skippedCount

      private final AtomicInteger skippedCount
    • listener

      private volatile GenerationTask.Listener listener
    • stopped

      private volatile boolean stopped
    • NEOFORGE_GENERATE_FORCED

      public static final TicketType<ChunkPos> NEOFORGE_GENERATE_FORCED
  • Constructor Details

    • GenerationTask

      public GenerationTask(ServerLevel serverLevel, int x, int z, int radius)
  • Method Details

    • getOkCount

      public int getOkCount()
    • getErrorCount

      public int getErrorCount()
    • getSkippedCount

      public int getSkippedCount()
    • getTotalCount

      public int getTotalCount()
    • run

      public void run(GenerationTask.Listener listener)
    • stop

      public void stop()
    • tryEnqueueTasks

      private void tryEnqueueTasks()
    • enqueueChunks

      private void enqueueChunks(it.unimi.dsi.fastutil.longs.LongList chunks)
    • acceptChunkResult

      private void acceptChunkResult(long chunk, ChunkResult<ChunkAccess> result)
    • collectChunks

      private it.unimi.dsi.fastutil.longs.LongList collectChunks(int count)
    • acquireChunk

      private void acquireChunk(long chunk)
    • releaseChunk

      private void releaseChunk(long chunk)
    • isChunkFullyGenerated

      private boolean isChunkFullyGenerated(ChunkPos chunkPosInLocalSpace)