Package com.plotsquared.core.queue
Class DelegateQueueCoordinator
java.lang.Object
com.plotsquared.core.queue.QueueCoordinator
com.plotsquared.core.queue.DelegateQueueCoordinator
- Direct Known Subclasses:
AreaBoundDelegateQueueCoordinator,LocationOffsetDelegateQueueCoordinator,ScopedQueueCoordinator
Queue that delegates to a parent queue.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProgressSubscriber(@NonNull ProgressSubscriber progressSubscriber) Add aProgressSubscriberto the Queue to subscribe to the relevant Chunk ProcessorvoidaddReadChunk(@NonNull BlockVector2 chunk) Add aBlockVector2Chunk coordinate to the Read Chunks listvoidaddReadChunks(@NonNull Set<BlockVector2> readChunks) Add a set ofBlockVector2Chunk coordinates to the Read Chunks listvoidcancel()Cancel the queuebooleanenqueue()Enqueue the queue to start itgetBlock(int x, int y, int z) Get a block at the given coordinates.Return the chunk consumer set to the queue or null if one is not setGet the task to be run when all chunks have been accessedGet theLightingModeto be used when setting blocksGet the list of chunks that are added manually.Get theCuboidRegiondesignated for direct regenerationGet the overridingSideEffectSetto be used by the queue if it exists, else nullgetWorld()Get the world the queue is writing tobooleanWhether the queue has any biomes to be setbooleanWhether the queue has any tiles being setbooleanWhether chunks should be unloaded after being accessedvoidregenChunk(int x, int z) Set a specific chunk at the chunk coordinates XZ to be regenerated.booleanSet a biome in XYZbooleanSet a biome in XZ.voidsetBiomesEnabled(boolean enabled) If the queue should accept biome placementbooleanSets the block at the coordinates provided to the given id.booleanSets the block at the coordinates provided to the given id.booleansetBlock(int x, int y, int z, @NonNull BlockState id) Sets the block at the coordinates provided to the given id.voidsetChunkConsumer(@NonNull Consumer<BlockVector2> consumer) Set the Consumer that will be executed on each chunk in queuevoidsetCompleteTask(Runnable whenDone) Set the task to be run when all chunks have been accessedbooleanAdd an entity to be createdvoidSet theLightingModeto be used when setting blocksvoidsetModified(long modified) Set when the queue was last modifiedvoidsetRegenRegion(@NonNull CuboidRegion regenRegion) Set theCuboidRegiondesignated for direct regenerationvoidsetSideEffectSet(SideEffectSet sideEffectSet) Set the overridingSideEffectSetto be used by the queue.booleansetTile(int x, int y, int z, @NonNull CompoundTag tag) Sets a tile entity at the coordinates provided to the given CompoundTagvoidsetUnloadAfter(boolean setUnloadAfter) Set whether chunks should be unloaded after being accessedintsize()Get the size of the queue in chunksvoidstart()Start the queueMethods inherited from class com.plotsquared.core.queue.QueueCoordinator
addEntities, getChunkObject, getForChunk, getForChunk, getMaxLayer, getMaxY, getMinLayer, getMinY, isForceSync, setBiomeCuboid, setChunkObject, setCuboid, setCuboid, setForceSync, setModified
-
Constructor Details
-
DelegateQueueCoordinator
-
-
Method Details
-
getParent
-
size
public int size()Description copied from class:QueueCoordinatorGet the size of the queue in chunks- Specified by:
sizein classQueueCoordinator- Returns:
- size
-
setModified
public void setModified(long modified) Description copied from class:QueueCoordinatorSet when the queue was last modified- Specified by:
setModifiedin classQueueCoordinator- Parameters:
modified- long of system millis
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Overrides:
setBlockin classQueueCoordinator- Parameters:
x- the x coordinate from from 0 to 15 inclusivey- the y coordinate from from 0 (inclusive) - maxHeight(exclusive)z- the z coordinate from 0 to 15 inclusivepattern- the pattern to set the block to- Returns:
- success or not
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Specified by:
setBlockin classQueueCoordinator- Parameters:
x- the x coordinate from from 0 to 15 inclusivey- the y coordinate from from 0 (inclusive) - maxHeight(exclusive)z- the z coordinate from 0 to 15 inclusiveid- the BaseBlock to set the block to- Returns:
- success or not
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Specified by:
setBlockin classQueueCoordinator- Parameters:
x- the x coordinate from from 0 to 15 inclusivey- the y coordinate from from 0 (inclusive) - maxHeight(exclusive)z- the z coordinate from 0 to 15 inclusiveid- the BlockState to set the block to- Returns:
- success or not
-
getBlock
Description copied from class:QueueCoordinatorGet a block at the given coordinates.- Specified by:
getBlockin classQueueCoordinator- Parameters:
x- block xy- block yz- block z- Returns:
- WorldEdit BlockState
-
setBiome
Description copied from class:QueueCoordinatorSet a biome in XZ. This will likely set to the whole column- Specified by:
setBiomein classQueueCoordinator- Parameters:
x- x coordinatez- z coordinatebiome- biome- Returns:
- success or not
-
setBiome
Description copied from class:QueueCoordinatorSet a biome in XYZ- Specified by:
setBiomein classQueueCoordinator- Parameters:
x- x coordinatey- y coordinatez- z coordinatebiome- biome- Returns:
- success or not
-
isSettingBiomes
public boolean isSettingBiomes()Description copied from class:QueueCoordinatorWhether the queue has any biomes to be set- Specified by:
isSettingBiomesin classQueueCoordinator- Returns:
- if setting biomes
-
setBiomesEnabled
public void setBiomesEnabled(boolean enabled) Description copied from class:QueueCoordinatorIf the queue should accept biome placement- Specified by:
setBiomesEnabledin classQueueCoordinator- Parameters:
enabled- If biomes should be enabled
-
setEntity
Description copied from class:QueueCoordinatorAdd an entity to be created- Specified by:
setEntityin classQueueCoordinator- Parameters:
entity- entity to add to queue- Returns:
- success or not
-
regenChunk
public void regenChunk(int x, int z) Description copied from class:QueueCoordinatorSet a specific chunk at the chunk coordinates XZ to be regenerated.- Specified by:
regenChunkin classQueueCoordinator- Parameters:
x- chunk xz- chunk z
-
getWorld
Description copied from class:QueueCoordinatorGet the world the queue is writing to- Specified by:
getWorldin classQueueCoordinator- Returns:
- world of the queue
-
setTile
Description copied from class:QueueCoordinatorSets a tile entity at the coordinates provided to the given CompoundTag- Specified by:
setTilein classQueueCoordinator- Parameters:
x- the x coordinate from from 0 to 15 inclusivey- the y coordinate from from 0 (inclusive) - maxHeight(exclusive)z- the z coordinate from 0 to 15 inclusivetag- the CompoundTag to set the tile to- Returns:
- success or not
-
isSettingTiles
public boolean isSettingTiles()Description copied from class:QueueCoordinatorWhether the queue has any tiles being set- Specified by:
isSettingTilesin classQueueCoordinator- Returns:
- if setting tiles
-
enqueue
public boolean enqueue()Description copied from class:QueueCoordinatorEnqueue the queue to start it- Overrides:
enqueuein classQueueCoordinator- Returns:
- success or not
-
start
public void start()Description copied from class:QueueCoordinatorStart the queue- Specified by:
startin classQueueCoordinator
-
cancel
public void cancel()Description copied from class:QueueCoordinatorCancel the queue- Specified by:
cancelin classQueueCoordinator
-
getCompleteTask
Description copied from class:QueueCoordinatorGet the task to be run when all chunks have been accessed- Specified by:
getCompleteTaskin classQueueCoordinator- Returns:
- task to be run when queue is complete
-
setCompleteTask
Description copied from class:QueueCoordinatorSet the task to be run when all chunks have been accessed- Specified by:
setCompleteTaskin classQueueCoordinator- Parameters:
whenDone- task to be run when queue is complete
-
getChunkConsumer
Description copied from class:QueueCoordinatorReturn the chunk consumer set to the queue or null if one is not set- Specified by:
getChunkConsumerin classQueueCoordinator- Returns:
- Consumer to be executed on each chunk in queue
-
setChunkConsumer
Description copied from class:QueueCoordinatorSet the Consumer that will be executed on each chunk in queue- Specified by:
setChunkConsumerin classQueueCoordinator- Parameters:
consumer- Consumer to be executed on each chunk in queue
-
addProgressSubscriber
Description copied from class:QueueCoordinatorAdd aProgressSubscriberto the Queue to subscribe to the relevant Chunk Processor- Specified by:
addProgressSubscriberin classQueueCoordinator
-
getLightingMode
Description copied from class:QueueCoordinatorGet theLightingModeto be used when setting blocks- Specified by:
getLightingModein classQueueCoordinator
-
setLightingMode
Description copied from class:QueueCoordinatorSet theLightingModeto be used when setting blocks- Specified by:
setLightingModein classQueueCoordinator- Parameters:
mode- lighting mode. Null to use default.
-
getSideEffectSet
Description copied from class:QueueCoordinatorGet the overridingSideEffectSetto be used by the queue if it exists, else null- Specified by:
getSideEffectSetin classQueueCoordinator- Returns:
- Overriding
SideEffectSetor null
-
setSideEffectSet
Description copied from class:QueueCoordinatorSet the overridingSideEffectSetto be used by the queue. Null to use default side effects.- Specified by:
setSideEffectSetin classQueueCoordinator- Parameters:
sideEffectSet- side effects to override with, or null to use default
-
getReadChunks
Description copied from class:QueueCoordinatorGet the list of chunks that are added manually. This usually indicated the queue is "read only".- Specified by:
getReadChunksin classQueueCoordinator- Returns:
- list of BlockVector2 of chunks that are to be "read"
-
addReadChunks
Description copied from class:QueueCoordinatorAdd a set ofBlockVector2Chunk coordinates to the Read Chunks list- Specified by:
addReadChunksin classQueueCoordinator- Parameters:
readChunks- set of BlockVector2 to add to "read" chunks
-
addReadChunk
Description copied from class:QueueCoordinatorAdd aBlockVector2Chunk coordinate to the Read Chunks list- Specified by:
addReadChunkin classQueueCoordinator- Parameters:
chunk- BlockVector2 to add to "read" chunks
-
isUnloadAfter
public boolean isUnloadAfter()Description copied from class:QueueCoordinatorWhether chunks should be unloaded after being accessed- Specified by:
isUnloadAfterin classQueueCoordinator- Returns:
- if is unloading chunks after accessing them
-
setUnloadAfter
public void setUnloadAfter(boolean setUnloadAfter) Description copied from class:QueueCoordinatorSet whether chunks should be unloaded after being accessed- Specified by:
setUnloadAfterin classQueueCoordinator- Parameters:
setUnloadAfter- if to unload chunks after being accessed
-
getRegenRegion
Description copied from class:QueueCoordinatorGet theCuboidRegiondesignated for direct regeneration- Specified by:
getRegenRegionin classQueueCoordinator- Returns:
- CuboidRegion to regenerate
-
setRegenRegion
Description copied from class:QueueCoordinatorSet theCuboidRegiondesignated for direct regeneration- Specified by:
setRegenRegionin classQueueCoordinator- Parameters:
regenRegion- CuboidRegion to regenerate
-