Package com.plotsquared.bukkit.queue
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 Summary
Modifier and TypeMethodDescriptionvoidcancel()intintvoidrun()voidstart()voidsubscribeToProgress(@NonNull com.plotsquared.core.queue.subscriber.ProgressSubscriber subscriber) Subscribe to coordinator progress updates
-
Method Details
-
start
public void start()- Specified by:
startin classcom.plotsquared.core.queue.ChunkCoordinator
-
cancel
public void cancel()- Specified by:
cancelin classcom.plotsquared.core.queue.ChunkCoordinator
-
run
public void run() -
getRemainingChunks
public int getRemainingChunks()- Specified by:
getRemainingChunksin classcom.plotsquared.core.queue.ChunkCoordinator
-
getTotalChunks
public int getTotalChunks()- Specified by:
getTotalChunksin classcom.plotsquared.core.queue.ChunkCoordinator
-
subscribeToProgress
public void subscribeToProgress(@NonNull com.plotsquared.core.queue.subscriber.ProgressSubscriber subscriber) Subscribe to coordinator progress updates- Parameters:
subscriber- Subscriber
-