Class MazeService

java.lang.Object
dev.despical.mazeengine.service.MazeService

public final class MazeService extends Object
Coordinates saved maze state, authorized operations, and their execution resources.

The service loads validated records through recovery, maintains name and region reservations, and delegates creation, regeneration, repair, removal, teleport resolution, and spatial checks to focused collaborators. A shared server-tick runner owns live world steps while bounded workers plan topology and a serial executor orders disk operations.

Operation tickets connect internal outcomes to public handles and events. State replacement and terminal settlement happen on the server thread; delayed worker callbacks are checked against their reservation tokens. Shutdown stops the ticker, releases resources, cancels pending work, and settles outstanding tickets without forgetting retained maze records.

  • Constructor Details

  • Method Details

    • records

      public Collection<MazeRecord> records()
    • activeOperationCount

      public int activeOperationCount()
    • operationListener

      public void operationListener(Consumer<MazeService.OperationOutcome> listener)
    • operation

      public MazeService.OperationTicket operation(String name)
    • currentOperation

      public boolean currentOperation(String name, UUID id)
    • progressPercent

      public int progressPercent(String name)
    • holdChunk

      public void holdChunk(org.bukkit.Chunk chunk)
    • releaseChunk

      public void releaseChunk(org.bukkit.Chunk chunk)
    • require

      public MazeRecord require(String name)
    • busy

      public boolean busy(String name)
    • selection

      public RegionSelection selection(org.bukkit.entity.Player player) throws Exception
      Throws:
      Exception
    • world

      public org.bukkit.World world(MazeRecord record)
    • authorize

      public void authorize(org.bukkit.command.CommandSender sender, MazeRecord record, String action)
    • validatePreview

      public void validatePreview(String name, org.bukkit.World world, Bounds bounds, int cells)
    • create

      public void create(org.bukkit.command.CommandSender sender, String name, org.bukkit.World world, int x, int y, int z, int width, int depth, long seed, Preset preset)
    • regenerate

      public void regenerate(org.bukkit.command.CommandSender sender, MazeRecord record, long seed)
    • regenerate

      public void regenerate(org.bukkit.command.CommandSender sender, MazeRecord record, long seed, boolean repair)
    • delete

      public void delete(org.bukkit.command.CommandSender sender, MazeRecord record, boolean restore)
    • cancel

      public void cancel(org.bukkit.command.CommandSender sender, String name)
    • progress

      public String progress(String name)
    • entrance

      public org.bukkit.Location entrance(MazeRecord record)
    • destination

      public org.bukkit.Location destination(MazeRecord record)
    • safeDestination

      public boolean safeDestination(org.bukkit.Location location)
    • setSpawn

      public void setSpawn(org.bukkit.entity.Player player, MazeRecord record, org.bukkit.Location location)
    • at

      public MazeRecord at(org.bukkit.Location location)
    • protectedAt

      public boolean protectedAt(org.bukkit.Location location)
    • mobSpawnBlockedAt

      public boolean mobSpawnBlockedAt(org.bukkit.Location location)
    • close

      public void close()