Class BukkitChunkCoordinator

java.lang.Object
com.plotsquared.core.queue.ChunkCoordinator
com.plotsquared.bukkit.queue.BukkitChunkCoordinator
All Implemented Interfaces:
Runnable

public final class BukkitChunkCoordinator extends com.plotsquared.core.queue.ChunkCoordinator
Utility that allows for the loading and coordination of chunk actions

The coordinator takes in collection of chunk coordinates, loads them and allows the caller to specify a sink for the loaded chunks. The coordinator will prevent the chunks from being unloaded until the sink has fully consumed the chunk

  • Method Details

    • start

      public void start()
      Specified by:
      start in class com.plotsquared.core.queue.ChunkCoordinator
    • cancel

      public void cancel()
      Specified by:
      cancel in class com.plotsquared.core.queue.ChunkCoordinator
    • run

      public void run()
    • getRemainingChunks

      public int getRemainingChunks()
      Specified by:
      getRemainingChunks in class com.plotsquared.core.queue.ChunkCoordinator
    • getTotalChunks

      public int getTotalChunks()
      Specified by:
      getTotalChunks in class com.plotsquared.core.queue.ChunkCoordinator
    • subscribeToProgress

      public void subscribeToProgress(@NonNull com.plotsquared.core.queue.subscriber.ProgressSubscriber subscriber)
      Subscribe to coordinator progress updates
      Parameters:
      subscriber - Subscriber