Package com.plotsquared.core.queue
Class BlockArrayCacheScopedQueueCoordinator
java.lang.Object
com.plotsquared.core.queue.QueueCoordinator
com.plotsquared.core.queue.DelegateQueueCoordinator
com.plotsquared.core.queue.ScopedQueueCoordinator
com.plotsquared.core.queue.BlockArrayCacheScopedQueueCoordinator
@ApiDescription(info="Internal use only. Subject to change at any time and created for specific use cases.")
public class BlockArrayCacheScopedQueueCoordinator
extends ScopedQueueCoordinator
QueueCoordinator that caches all blocks set to it in a given array of form BlockState[][][]. An offset can be
applied to blocks set to it, and the scope limited. This should have blocks set to it one chunk at a time, based on the
result of getMin() and getMax().
The min and max points of this queue are offset according to the minimum point given in the constructor, and the offsets set
in setOffsetX(int) and
setOffsetZ(int)-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance -
Method Summary
Modifier and TypeMethodDescriptionvoidgetBlock(int x, int y, int z) Get a block at the given coordinates.BlockState[][][]getMax()getMin()booleanSet a biome in XYZbooleanSet a biome in XZ.booleanSets 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.voidsetOffsetX(int offsetX) voidsetOffsetZ(int offsetZ) booleansetTile(int x, int y, int z, @NonNull CompoundTag tag) Sets a tile entity at the coordinates provided to the given CompoundTagintsize()Get the size of the queue in chunksMethods inherited from class com.plotsquared.core.queue.DelegateQueueCoordinator
addProgressSubscriber, addReadChunk, addReadChunks, cancel, enqueue, getChunkConsumer, getCompleteTask, getLightingMode, getParent, getReadChunks, getRegenRegion, getSideEffectSet, getWorld, isSettingBiomes, isSettingTiles, isUnloadAfter, regenChunk, setBiomesEnabled, setChunkConsumer, setCompleteTask, setEntity, setLightingMode, setModified, setRegenRegion, setSideEffectSet, setUnloadAfter, startMethods 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
-
BlockArrayCacheScopedQueueCoordinator
Construct a new instance- Parameters:
min- Inclusive location of the minimum point to limit the scope to.max- Inclusive location of the maximum point to limit the scope to.- Since:
- 6.8.0
-
-
Method Details
-
getBlockStates
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Overrides:
setBlockin classScopedQueueCoordinator- 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
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Overrides:
setBlockin classScopedQueueCoordinator- 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
-
getMin
- Overrides:
getMinin classScopedQueueCoordinator
-
getMax
- Overrides:
getMaxin classScopedQueueCoordinator
-
setBlock
Description copied from class:QueueCoordinatorSets the block at the coordinates provided to the given id.- Overrides:
setBlockin classScopedQueueCoordinator- 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
-
getBlock
Description copied from class:QueueCoordinatorGet a block at the given coordinates.- Overrides:
getBlockin classDelegateQueueCoordinator- Parameters:
x- block xy- block yz- block z- Returns:
- WorldEdit BlockState
-
setOffsetX
public void setOffsetX(int offsetX) -
setOffsetZ
public void setOffsetZ(int offsetZ) -
size
public int size()Description copied from class:QueueCoordinatorGet the size of the queue in chunks- Overrides:
sizein classDelegateQueueCoordinator- Returns:
- size
-
setBiome
Description copied from class:QueueCoordinatorSet a biome in XZ. This will likely set to the whole column- Overrides:
setBiomein classScopedQueueCoordinator- Parameters:
x- x coordinatez- z coordinatebiome- biome- Returns:
- success or not
-
setBiome
Description copied from class:QueueCoordinatorSet a biome in XYZ- Overrides:
setBiomein classScopedQueueCoordinator- Parameters:
x- x coordinatey- y coordinatez- z coordinatebiome- biome- Returns:
- success or not
-
fillBiome
- Overrides:
fillBiomein classScopedQueueCoordinator
-
setTile
Description copied from class:QueueCoordinatorSets a tile entity at the coordinates provided to the given CompoundTag- Overrides:
setTilein classScopedQueueCoordinator- 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
-