Interface MazeOperations


public interface MazeOperations
Submits maze creation, regeneration, repair, and removal requests.

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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Determines what happens to the maze's block volume during removal.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(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.
    repair(org.bukkit.command.CommandSender actor, MazeId id)
    Starts repair of the structure described by the saved maze plan.
  • Method Details

    • create

      MazeOperation create(org.bukkit.command.CommandSender actor, CreateMazeRequest request)
      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 with mazeengine.use and mazeengine.create
      request - the maze identifier, origin, grid size, preset, and overrides
      Returns:
      a handle for this accepted creation request
      Throws:
      NullPointerException - if actor or request is null
      IllegalArgumentException - if permissions, preset, world, geometry, limits, or conflicting reservations reject the request
      IllegalStateException - if called off the server thread or the plugin is disabled
    • regenerate

      MazeOperation regenerate(org.bukkit.command.CommandSender actor, MazeId id, long seed)
      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 rights
      id - the existing maze identifier
      seed - 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 regeneration
      IllegalStateException - if called off the server thread or the plugin is disabled
    • repair

      MazeOperation repair(org.bukkit.command.CommandSender actor, MazeId id)
      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 rights
      id - 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 repair
      IllegalStateException - 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 rights
      id - the maze to remove
      mode - the terrain handling policy
      Returns:
      a handle for this accepted removal request
      Throws:
      NullPointerException - if mode is null
      IllegalArgumentException - if the maze, world, permissions, player safety, required restore snapshot, or conflicting reservations reject removal
      IllegalStateException - if called off the server thread or the plugin is disabled