Package com.plotsquared.bukkit.queue
Class BukkitChunkCoordinator
java.lang.Object
com.plotsquared.core.queue.ChunkCoordinator
com.plotsquared.bukkit.queue.BukkitChunkCoordinator
- All Implemented Interfaces:
Runnable
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 Summary
Modifier and TypeMethodDescriptionvoid
cancel()
int
int
void
run()
void
start()
void
subscribeToProgress
(@NonNull ProgressSubscriber subscriber) Subscribe to coordinator progress updates
-
Method Details
-
start
public void start()- Specified by:
start
in classChunkCoordinator
-
cancel
public void cancel()- Specified by:
cancel
in classChunkCoordinator
-
run
public void run() -
getRemainingChunks
public int getRemainingChunks()- Specified by:
getRemainingChunks
in classChunkCoordinator
-
getTotalChunks
public int getTotalChunks()- Specified by:
getTotalChunks
in classChunkCoordinator
-
subscribeToProgress
Subscribe to coordinator progress updates- Parameters:
subscriber
- Subscriber
-