Class PriorityStructureQueue

java.lang.Object
com.ryandw11.structure.structure.PriorityStructureQueue

public class PriorityStructureQueue extends Object
Maintains a priority queue of structures for a spawn location.
  • Constructor Details

    • PriorityStructureQueue

      public PriorityStructureQueue(@NotNull @NotNull List<Structure> structures, @NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull org.bukkit.Chunk chunk)
      Create a priority queue of structures for a specific spawn location.

      Structure.canSpawn(Block, Chunk) must return true for the specified block and chunk for it to be added to the queue.

      Parameters:
      structures - The list of structures to attempt and add to the queue.
      block - The block to test the spawn conditions for.
      chunk - The chunk to test the spawn conditions for.
  • Method Details

    • hasNextStructure

      public boolean hasNextStructure()
      Check if there is a next structure to retrieve from the priority queue.
      Returns:
      If there is a next structure to retrieve.
    • getNextStructure

      @Nullable public @Nullable Structure getNextStructure()
      Get the next structure from the priority queue.
      Returns:
      The next structure. Null if queue empty.