Class DelegateQueueCoordinator

java.lang.Object
com.plotsquared.core.queue.QueueCoordinator
com.plotsquared.core.queue.DelegateQueueCoordinator
Direct Known Subclasses:
AreaBoundDelegateQueueCoordinator, LocationOffsetDelegateQueueCoordinator, ScopedQueueCoordinator

public class DelegateQueueCoordinator extends QueueCoordinator
Queue that delegates to a parent queue.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addProgressSubscriber​(@NonNull ProgressSubscriber progressSubscriber)
    Add a ProgressSubscriber to the Queue to subscribe to the relevant Chunk Processor
    void
    addReadChunk​(@NonNull com.sk89q.worldedit.math.BlockVector2 chunk)
    Add a BlockVector2 Chunk coordinate to the Read Chunks list
    void
    addReadChunks​(@NonNull Set<com.sk89q.worldedit.math.BlockVector2> readChunks)
    Add a set of BlockVector2 Chunk coordinates to the Read Chunks list
    void
    Cancel the queue
    boolean
    Enqueue the queue to start it
    @Nullable com.sk89q.worldedit.world.block.BlockState
    getBlock​(int x, int y, int z)
    Get a block at the given coordinates.
    @Nullable Consumer<com.sk89q.worldedit.math.BlockVector2>
    Return the chunk consumer set to the queue or null if one is not set
    Get the task to be run when all chunks have been accessed
    @NonNull LightingMode
    Get the LightingMode to be used when setting blocks
     
    @NonNull List<com.sk89q.worldedit.math.BlockVector2>
    Get the list of chunks that are added manually.
    @Nullable com.sk89q.worldedit.regions.CuboidRegion
    Get the CuboidRegion designated for direct regeneration
    @Nullable com.sk89q.worldedit.world.World
    Get the world the queue is writing to
    boolean
    Whether the queue has any biomes to be set
    boolean
    Whether the queue has any tiles being set
    boolean
    Whether chunks should be unloaded after being accessed
    void
    regenChunk​(int x, int z)
    Set a specific chunk at the chunk coordinates XZ to be regenerated.
    boolean
    setBiome​(int x, int y, int z, @NonNull com.sk89q.worldedit.world.biome.BiomeType biome)
    Set a biome in XYZ
    boolean
    setBiome​(int x, int z, @NonNull com.sk89q.worldedit.world.biome.BiomeType biome)
    Set a biome in XZ.
    boolean
    setBlock​(int x, int y, int z, @NonNull com.sk89q.worldedit.function.pattern.Pattern pattern)
    Sets the block at the coordinates provided to the given id.
    boolean
    setBlock​(int x, int y, int z, @NonNull com.sk89q.worldedit.world.block.BaseBlock id)
    Sets the block at the coordinates provided to the given id.
    boolean
    setBlock​(int x, int y, int z, @NonNull com.sk89q.worldedit.world.block.BlockState id)
    Sets the block at the coordinates provided to the given id.
    void
    setChunkConsumer​(@NonNull Consumer<com.sk89q.worldedit.math.BlockVector2> consumer)
    Set the Consumer that will be executed on each chunk in queue
    void
    Set the task to be run when all chunks have been accessed
    boolean
    setEntity​(@NonNull com.sk89q.worldedit.entity.Entity entity)
    Add an entity to be created
    void
    setLightingMode​(@Nullable LightingMode mode)
    Set the LightingMode to be used when setting blocks
    void
    setModified​(long modified)
    Set when the queue was last modified
    void
    setRegenRegion​(@NonNull com.sk89q.worldedit.regions.CuboidRegion regenRegion)
    Set the CuboidRegion designated for direct regeneration
    boolean
    setTile​(int x, int y, int z, @NonNull com.sk89q.jnbt.CompoundTag tag)
    Sets a tile entity at the coordinates provided to the given CompoundTag
    void
    setUnloadAfter​(boolean setUnloadAfter)
    Set whether chunks should be unloaded after being accessed
    int
    Get the size of the queue in chunks
    void
    Start the queue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DelegateQueueCoordinator

      public DelegateQueueCoordinator(QueueCoordinator parent)
  • Method Details

    • getParent

      public QueueCoordinator getParent()
    • size

      public int size()
      Description copied from class: QueueCoordinator
      Get the size of the queue in chunks
      Specified by:
      size in class QueueCoordinator
      Returns:
      size
    • setModified

      public void setModified(long modified)
      Description copied from class: QueueCoordinator
      Set when the queue was last modified
      Specified by:
      setModified in class QueueCoordinator
      Parameters:
      modified - long of system millis
    • setBlock

      public boolean setBlock(int x, int y, int z, @NonNull com.sk89q.worldedit.function.pattern.Pattern pattern)
      Description copied from class: QueueCoordinator
      Sets the block at the coordinates provided to the given id.
      Overrides:
      setBlock in class QueueCoordinator
      Parameters:
      x - the x coordinate from from 0 to 15 inclusive
      y - the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
      z - the z coordinate from 0 to 15 inclusive
      pattern - the pattern to set the block to
      Returns:
      success or not
    • setBlock

      public boolean setBlock(int x, int y, int z, @NonNull com.sk89q.worldedit.world.block.BaseBlock id)
      Description copied from class: QueueCoordinator
      Sets the block at the coordinates provided to the given id.
      Specified by:
      setBlock in class QueueCoordinator
      Parameters:
      x - the x coordinate from from 0 to 15 inclusive
      y - the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
      z - the z coordinate from 0 to 15 inclusive
      id - the BaseBlock to set the block to
      Returns:
      success or not
    • setBlock

      public boolean setBlock(int x, int y, int z, @NonNull com.sk89q.worldedit.world.block.BlockState id)
      Description copied from class: QueueCoordinator
      Sets the block at the coordinates provided to the given id.
      Specified by:
      setBlock in class QueueCoordinator
      Parameters:
      x - the x coordinate from from 0 to 15 inclusive
      y - the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
      z - the z coordinate from 0 to 15 inclusive
      id - the BlockState to set the block to
      Returns:
      success or not
    • getBlock

      public @Nullable com.sk89q.worldedit.world.block.BlockState getBlock(int x, int y, int z)
      Description copied from class: QueueCoordinator
      Get a block at the given coordinates.
      Specified by:
      getBlock in class QueueCoordinator
      Parameters:
      x - block x
      y - block y
      z - block z
      Returns:
      WorldEdit BlockState
    • setBiome

      public boolean setBiome(int x, int z, @NonNull com.sk89q.worldedit.world.biome.BiomeType biome)
      Description copied from class: QueueCoordinator
      Set a biome in XZ. This will likely set to the whole column
      Specified by:
      setBiome in class QueueCoordinator
      Parameters:
      x - x coordinate
      z - z coordinate
      biome - biome
      Returns:
      success or not
    • setBiome

      public boolean setBiome(int x, int y, int z, @NonNull com.sk89q.worldedit.world.biome.BiomeType biome)
      Description copied from class: QueueCoordinator
      Set a biome in XYZ
      Specified by:
      setBiome in class QueueCoordinator
      Parameters:
      x - x coordinate
      y - y coordinate
      z - z coordinate
      biome - biome
      Returns:
      success or not
    • isSettingBiomes

      public boolean isSettingBiomes()
      Description copied from class: QueueCoordinator
      Whether the queue has any biomes to be set
      Specified by:
      isSettingBiomes in class QueueCoordinator
      Returns:
      if setting biomes
    • setEntity

      public boolean setEntity(@NonNull com.sk89q.worldedit.entity.Entity entity)
      Description copied from class: QueueCoordinator
      Add an entity to be created
      Specified by:
      setEntity in class QueueCoordinator
      Parameters:
      entity - entity to add to queue
      Returns:
      success or not
    • regenChunk

      public void regenChunk(int x, int z)
      Description copied from class: QueueCoordinator
      Set a specific chunk at the chunk coordinates XZ to be regenerated.
      Specified by:
      regenChunk in class QueueCoordinator
      Parameters:
      x - chunk x
      z - chunk z
    • getWorld

      public @Nullable com.sk89q.worldedit.world.World getWorld()
      Description copied from class: QueueCoordinator
      Get the world the queue is writing to
      Specified by:
      getWorld in class QueueCoordinator
      Returns:
      world of the queue
    • setTile

      public boolean setTile(int x, int y, int z, @NonNull com.sk89q.jnbt.CompoundTag tag)
      Description copied from class: QueueCoordinator
      Sets a tile entity at the coordinates provided to the given CompoundTag
      Specified by:
      setTile in class QueueCoordinator
      Parameters:
      x - the x coordinate from from 0 to 15 inclusive
      y - the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
      z - the z coordinate from 0 to 15 inclusive
      tag - the CompoundTag to set the tile to
      Returns:
      success or not
    • isSettingTiles

      public boolean isSettingTiles()
      Description copied from class: QueueCoordinator
      Whether the queue has any tiles being set
      Specified by:
      isSettingTiles in class QueueCoordinator
      Returns:
      if setting tiles
    • enqueue

      public boolean enqueue()
      Description copied from class: QueueCoordinator
      Enqueue the queue to start it
      Overrides:
      enqueue in class QueueCoordinator
      Returns:
      success or not
    • start

      public void start()
      Description copied from class: QueueCoordinator
      Start the queue
      Specified by:
      start in class QueueCoordinator
    • cancel

      public void cancel()
      Description copied from class: QueueCoordinator
      Cancel the queue
      Specified by:
      cancel in class QueueCoordinator
    • getCompleteTask

      public Runnable getCompleteTask()
      Description copied from class: QueueCoordinator
      Get the task to be run when all chunks have been accessed
      Specified by:
      getCompleteTask in class QueueCoordinator
      Returns:
      task to be run when queue is complete
    • setCompleteTask

      public void setCompleteTask(Runnable whenDone)
      Description copied from class: QueueCoordinator
      Set the task to be run when all chunks have been accessed
      Specified by:
      setCompleteTask in class QueueCoordinator
      Parameters:
      whenDone - task to be run when queue is complete
    • getChunkConsumer

      public @Nullable Consumer<com.sk89q.worldedit.math.BlockVector2> 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 class QueueCoordinator
      Returns:
      Consumer to be executed on each chunk in queue
    • setChunkConsumer

      public void setChunkConsumer(@NonNull Consumer<com.sk89q.worldedit.math.BlockVector2> consumer)
      Description copied from class: QueueCoordinator
      Set the Consumer that will be executed on each chunk in queue
      Specified by:
      setChunkConsumer in class QueueCoordinator
      Parameters:
      consumer - Consumer to be executed on each chunk in queue
    • addProgressSubscriber

      public void addProgressSubscriber(@NonNull ProgressSubscriber progressSubscriber)
      Description copied from class: QueueCoordinator
      Add a ProgressSubscriber to the Queue to subscribe to the relevant Chunk Processor
      Specified by:
      addProgressSubscriber in class QueueCoordinator
    • getLightingMode

      public @NonNull LightingMode getLightingMode()
      Description copied from class: QueueCoordinator
      Get the LightingMode to be used when setting blocks
      Specified by:
      getLightingMode in class QueueCoordinator
    • setLightingMode

      public void setLightingMode(@Nullable LightingMode mode)
      Description copied from class: QueueCoordinator
      Set the LightingMode to be used when setting blocks
      Specified by:
      setLightingMode in class QueueCoordinator
      Parameters:
      mode - lighting mode. Null to use default.
    • getReadChunks

      public @NonNull List<com.sk89q.worldedit.math.BlockVector2> 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 class QueueCoordinator
      Returns:
      list of BlockVector2 of chunks that are to be "read"
    • addReadChunks

      public void addReadChunks(@NonNull Set<com.sk89q.worldedit.math.BlockVector2> readChunks)
      Description copied from class: QueueCoordinator
      Add a set of BlockVector2 Chunk coordinates to the Read Chunks list
      Specified by:
      addReadChunks in class QueueCoordinator
      Parameters:
      readChunks - set of BlockVector2 to add to "read" chunks
    • addReadChunk

      public void addReadChunk(@NonNull com.sk89q.worldedit.math.BlockVector2 chunk)
      Description copied from class: QueueCoordinator
      Add a BlockVector2 Chunk coordinate to the Read Chunks list
      Specified by:
      addReadChunk in class QueueCoordinator
      Parameters:
      chunk - BlockVector2 to add to "read" chunks
    • isUnloadAfter

      public boolean isUnloadAfter()
      Description copied from class: QueueCoordinator
      Whether chunks should be unloaded after being accessed
      Specified by:
      isUnloadAfter in class QueueCoordinator
      Returns:
      if is unloading chunks after accessing them
    • setUnloadAfter

      public void setUnloadAfter(boolean setUnloadAfter)
      Description copied from class: QueueCoordinator
      Set whether chunks should be unloaded after being accessed
      Specified by:
      setUnloadAfter in class QueueCoordinator
      Parameters:
      setUnloadAfter - if to unload chunks after being accessed
    • getRegenRegion

      public @Nullable com.sk89q.worldedit.regions.CuboidRegion getRegenRegion()
      Description copied from class: QueueCoordinator
      Get the CuboidRegion designated for direct regeneration
      Specified by:
      getRegenRegion in class QueueCoordinator
      Returns:
      CuboidRegion to regenerate
    • setRegenRegion

      public void setRegenRegion(@NonNull com.sk89q.worldedit.regions.CuboidRegion regenRegion)
      Description copied from class: QueueCoordinator
      Set the CuboidRegion designated for direct regeneration
      Specified by:
      setRegenRegion in class QueueCoordinator
      Parameters:
      regenRegion - CuboidRegion to regenerate