Interface MazeOperations
Call this service on the server thread while MazeEngine is enabled. The actor
receives ordinary plugin feedback and must have mazeengine.use, the
action permission, and any ownership or management rights required by that
action. Non-player administrative actors use the normal administrative rules.
Validation performed before submission throws directly and produces no operation handle. Once accepted, planning, protection, storage, or block-work failures complete the handle exceptionally. Completion does not imply that the actor was teleported, and cancellation does not guarantee a rollback.
Use MazeOperation.completion() for the final result and
MazeOperation.progress() for the current state. Never block the server
thread waiting for an operation to finish.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDetermines what happens to the maze's block volume during removal. -
Method Summary
Modifier and TypeMethodDescriptioncreate(org.bukkit.command.CommandSender actor, CreateMazeRequest request) Starts creation of a new maze using a validated request.delete(org.bukkit.command.CommandSender actor, MazeId id, MazeOperations.RemovalMode mode) Starts removal of a maze and its persisted record.regenerate(org.bukkit.command.CommandSender actor, MazeId id, long seed) Starts a full rebuild of an existing maze with the supplied seed.Starts repair of the structure described by the saved maze plan.
-
Method Details
-
create
Starts creation of a new maze using a validated request.Unspecified overrides inherit the selected current preset. An omitted seed is generated when the request is submitted. A player's UUID becomes the owner; a non-player actor produces an owner with the zero UUID.
The name is reserved before asynchronous topology planning starts. The handle can therefore exist before the maze appears in the registry.
- Parameters:
actor- the sender withmazeengine.useandmazeengine.createrequest- the maze identifier, origin, grid size, preset, and overrides- Returns:
- a handle for this accepted creation request
- Throws:
NullPointerException- ifactororrequestis nullIllegalArgumentException- if permissions, preset, world, geometry, limits, or conflicting reservations reject the requestIllegalStateException- if called off the server thread or the plugin is disabled
-
regenerate
Starts a full rebuild of an existing maze with the supplied seed.The rebuild uses the maze's frozen preset and grid dimensions. Its original terrain snapshot is retained rather than replaced by a snapshot of the maze. Using the saved seed reuses the saved topology; another seed generates a new layout. The full structure can overwrite contents within its bounds.
- Parameters:
actor- the sender with regeneration permission and ownership or management rightsid- the existing maze identifierseed- the deterministic seed to use for the rebuilt maze- Returns:
- a handle for this accepted regeneration request
- Throws:
IllegalArgumentException- if the maze, world, permissions, safety checks, required original snapshot, or conflicting reservations reject regenerationIllegalStateException- if called off the server thread or the plugin is disabled
-
repair
Starts repair of the structure described by the saved maze plan.Repair retains the current seed and topology and restores planned non-air structure blocks. Planned air blocks are skipped, preserving passage contents. It uses regeneration permission and the same ownership checks.
- Parameters:
actor- the sender with regeneration permission and ownership or management rightsid- the existing maze identifier- Returns:
- a handle for this accepted repair request
- Throws:
IllegalArgumentException- if the maze, world, permissions, safety checks, required original snapshot, or conflicting reservations reject repairIllegalStateException- if called off the server thread or the plugin is disabled
-
delete
MazeOperation delete(org.bukkit.command.CommandSender actor, MazeId id, MazeOperations.RemovalMode mode) Starts removal of a maze and its persisted record.The removal mode determines whether the original terrain is restored or the bounded volume is cleared to air. This API submits removal immediately; integrations presenting a player-facing destructive action should provide their own confirmation before calling it.
On success, the result describes the removed maze with
MazeSnapshot.Status.DELETED. The identifier is then absent from the registry and can be used again.- Parameters:
actor- the sender with deletion permission and ownership or management rightsid- the maze to removemode- the terrain handling policy- Returns:
- a handle for this accepted removal request
- Throws:
NullPointerException- ifmodeis nullIllegalArgumentException- if the maze, world, permissions, player safety, required restore snapshot, or conflicting reservations reject removalIllegalStateException- if called off the server thread or the plugin is disabled
-