Package com.ryandw11.structure.structure
Class PriorityStructureQueue
java.lang.Object
com.ryandw11.structure.structure.PriorityStructureQueue
Maintains a priority queue of structures for a spawn location.
-
Constructor Summary
ConstructorDescriptionPriorityStructureQueue(@NotNull List<Structure> structures, @NotNull org.bukkit.block.Block block, @NotNull org.bukkit.Chunk chunk)
Create a priority queue of structures for a specific spawn location. -
Method Summary
Modifier and TypeMethodDescription@Nullable Structure
Get the next structure from the priority queue.boolean
Check if there is a next structure to retrieve from the priority queue.
-
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
Get the next structure from the priority queue.- Returns:
- The next structure. Null if queue empty.
-