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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProgressSubscriber
(@NonNull ProgressSubscriber progressSubscriber) Add aProgressSubscriber
to the Queue to subscribe to the relevant Chunk Processorvoid
addReadChunk
(@NonNull BlockVector2 chunk) Add aBlockVector2
Chunk coordinate to the Read Chunks listvoid
addReadChunks
(@NonNull Set<BlockVector2> readChunks) Add a set ofBlockVector2
Chunk coordinates to the Read Chunks listvoid
cancel()
Cancel the queueboolean
enqueue()
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 theLightingMode
to be used when setting blocksGet the list of chunks that are added manually.Get theCuboidRegion
designated for direct regenerationGet the overridingSideEffectSet
to be used by the queue if it exists, else nullgetWorld()
Get the world the queue is writing toboolean
Whether the queue has any biomes to be setboolean
Whether the queue has any tiles being setboolean
Whether chunks should be unloaded after being accessedvoid
regenChunk
(int x, int z) Set a specific chunk at the chunk coordinates XZ to be regenerated.boolean
Set a biome in XYZboolean
Set a biome in XZ.void
setBiomesEnabled
(boolean enabled) If the queue should accept biome placementboolean
Sets the block at the coordinates provided to the given id.boolean
Sets the block at the coordinates provided to the given id.boolean
setBlock
(int x, int y, int z, @NonNull BlockState id) Sets the block at the coordinates provided to the given id.void
setChunkConsumer
(@NonNull Consumer<BlockVector2> consumer) Set the Consumer that will be executed on each chunk in queuevoid
setCompleteTask
(Runnable whenDone) Set the task to be run when all chunks have been accessedboolean
Add an entity to be createdvoid
Set theLightingMode
to be used when setting blocksvoid
setModified
(long modified) Set when the queue was last modifiedvoid
setRegenRegion
(@NonNull CuboidRegion regenRegion) Set theCuboidRegion
designated for direct regenerationvoid
setSideEffectSet
(SideEffectSet sideEffectSet) Set the overridingSideEffectSet
to be used by the queue.boolean
setTile
(int x, int y, int z, @NonNull CompoundTag tag) Sets a tile entity at the coordinates provided to the given CompoundTagvoid
setUnloadAfter
(boolean setUnloadAfter) Set whether chunks should be unloaded after being accessedint
size()
Get the size of the queue in chunksvoid
start()
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
Description copied from class:QueueCoordinator
Get the size of the queue in chunks- Specified by:
size
in classQueueCoordinator
- Returns:
- size
-
setModified
Description copied from class:QueueCoordinator
Set when the queue was last modified- Specified by:
setModified
in classQueueCoordinator
- Parameters:
modified
- long of system millis
-
setBlock
Description copied from class:QueueCoordinator
Sets the block at the coordinates provided to the given id.- Overrides:
setBlock
in 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:QueueCoordinator
Sets the block at the coordinates provided to the given id.- Specified by:
setBlock
in 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:QueueCoordinator
Sets the block at the coordinates provided to the given id.- Specified by:
setBlock
in 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:QueueCoordinator
Get a block at the given coordinates.- Specified by:
getBlock
in classQueueCoordinator
- Parameters:
x
- block xy
- block yz
- block z- Returns:
- WorldEdit BlockState
-
setBiome
Description copied from class:QueueCoordinator
Set a biome in XZ. This will likely set to the whole column- Specified by:
setBiome
in classQueueCoordinator
- Parameters:
x
- x coordinatez
- z coordinatebiome
- biome- Returns:
- success or not
-
setBiome
Description copied from class:QueueCoordinator
Set a biome in XYZ- Specified by:
setBiome
in classQueueCoordinator
- Parameters:
x
- x coordinatey
- y coordinatez
- z coordinatebiome
- biome- Returns:
- success or not
-
isSettingBiomes
Description copied from class:QueueCoordinator
Whether the queue has any biomes to be set- Specified by:
isSettingBiomes
in classQueueCoordinator
- Returns:
- if setting biomes
-
setBiomesEnabled
Description copied from class:QueueCoordinator
If the queue should accept biome placement- Specified by:
setBiomesEnabled
in classQueueCoordinator
- Parameters:
enabled
- If biomes should be enabled
-
setEntity
Description copied from class:QueueCoordinator
Add an entity to be created- Specified by:
setEntity
in classQueueCoordinator
- Parameters:
entity
- entity to add to queue- Returns:
- success or not
-
regenChunk
Description copied from class:QueueCoordinator
Set a specific chunk at the chunk coordinates XZ to be regenerated.- Specified by:
regenChunk
in classQueueCoordinator
- Parameters:
x
- chunk xz
- chunk z
-
getWorld
Description copied from class:QueueCoordinator
Get the world the queue is writing to- Specified by:
getWorld
in classQueueCoordinator
- Returns:
- world of the queue
-
setTile
Description copied from class:QueueCoordinator
Sets a tile entity at the coordinates provided to the given CompoundTag- Specified by:
setTile
in 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
Description copied from class:QueueCoordinator
Whether the queue has any tiles being set- Specified by:
isSettingTiles
in classQueueCoordinator
- Returns:
- if setting tiles
-
enqueue
Description copied from class:QueueCoordinator
Enqueue the queue to start it- Overrides:
enqueue
in classQueueCoordinator
- Returns:
- success or not
-
start
Description copied from class:QueueCoordinator
Start the queue- Specified by:
start
in classQueueCoordinator
-
cancel
Description copied from class:QueueCoordinator
Cancel the queue- Specified by:
cancel
in classQueueCoordinator
-
getCompleteTask
Description copied from class:QueueCoordinator
Get the task to be run when all chunks have been accessed- Specified by:
getCompleteTask
in classQueueCoordinator
- Returns:
- task to be run when queue is complete
-
setCompleteTask
Description copied from class:QueueCoordinator
Set the task to be run when all chunks have been accessed- Specified by:
setCompleteTask
in classQueueCoordinator
- Parameters:
whenDone
- task to be run when queue is complete
-
getChunkConsumer
Description copied from class:QueueCoordinator
Return the chunk consumer set to the queue or null if one is not set- Specified by:
getChunkConsumer
in classQueueCoordinator
- Returns:
- Consumer to be executed on each chunk in queue
-
setChunkConsumer
Description copied from class:QueueCoordinator
Set the Consumer that will be executed on each chunk in queue- Specified by:
setChunkConsumer
in classQueueCoordinator
- Parameters:
consumer
- Consumer to be executed on each chunk in queue
-
addProgressSubscriber
Description copied from class:QueueCoordinator
Add aProgressSubscriber
to the Queue to subscribe to the relevant Chunk Processor- Specified by:
addProgressSubscriber
in classQueueCoordinator
-
getLightingMode
Description copied from class:QueueCoordinator
Get theLightingMode
to be used when setting blocks- Specified by:
getLightingMode
in classQueueCoordinator
-
setLightingMode
Description copied from class:QueueCoordinator
Set theLightingMode
to be used when setting blocks- Specified by:
setLightingMode
in classQueueCoordinator
- Parameters:
mode
- lighting mode. Null to use default.
-
getSideEffectSet
Description copied from class:QueueCoordinator
Get the overridingSideEffectSet
to be used by the queue if it exists, else null- Specified by:
getSideEffectSet
in classQueueCoordinator
- Returns:
- Overriding
SideEffectSet
or null
-
setSideEffectSet
Description copied from class:QueueCoordinator
Set the overridingSideEffectSet
to be used by the queue. Null to use default side effects.- Specified by:
setSideEffectSet
in classQueueCoordinator
- Parameters:
sideEffectSet
- side effects to override with, or null to use default
-
getReadChunks
Description copied from class:QueueCoordinator
Get the list of chunks that are added manually. This usually indicated the queue is "read only".- Specified by:
getReadChunks
in classQueueCoordinator
- Returns:
- list of BlockVector2 of chunks that are to be "read"
-
addReadChunks
Description copied from class:QueueCoordinator
Add a set ofBlockVector2
Chunk coordinates to the Read Chunks list- Specified by:
addReadChunks
in classQueueCoordinator
- Parameters:
readChunks
- set of BlockVector2 to add to "read" chunks
-
addReadChunk
Description copied from class:QueueCoordinator
Add aBlockVector2
Chunk coordinate to the Read Chunks list- Specified by:
addReadChunk
in classQueueCoordinator
- Parameters:
chunk
- BlockVector2 to add to "read" chunks
-
isUnloadAfter
Description copied from class:QueueCoordinator
Whether chunks should be unloaded after being accessed- Specified by:
isUnloadAfter
in classQueueCoordinator
- Returns:
- if is unloading chunks after accessing them
-
setUnloadAfter
Description copied from class:QueueCoordinator
Set whether chunks should be unloaded after being accessed- Specified by:
setUnloadAfter
in classQueueCoordinator
- Parameters:
setUnloadAfter
- if to unload chunks after being accessed
-
getRegenRegion
Description copied from class:QueueCoordinator
Get theCuboidRegion
designated for direct regeneration- Specified by:
getRegenRegion
in classQueueCoordinator
- Returns:
- CuboidRegion to regenerate
-
setRegenRegion
Description copied from class:QueueCoordinator
Set theCuboidRegion
designated for direct regeneration- Specified by:
setRegenRegion
in classQueueCoordinator
- Parameters:
regenRegion
- CuboidRegion to regenerate
-