Class MazeService
java.lang.Object
dev.despical.mazeengine.service.MazeService
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classReports a creation request conflicting with an existing saved maze name.static final recordCarries the terminal record or failure delivered to the operation observer.static final recordBinds a unique accepted operation to its internal completion future.static final classReports an identifier with no current saved maze record. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintat(org.bukkit.Location location) voidauthorize(org.bukkit.command.CommandSender sender, MazeRecord record, String action) booleanvoidvoidclose()voidcreate(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) booleancurrentOperation(String name, UUID id) voiddelete(org.bukkit.command.CommandSender sender, MazeRecord record, boolean restore) org.bukkit.Locationdestination(MazeRecord record) org.bukkit.Locationentrance(MazeRecord record) voidholdChunk(org.bukkit.Chunk chunk) booleanmobSpawnBlockedAt(org.bukkit.Location location) voidintprogressPercent(String name) booleanprotectedAt(org.bukkit.Location location) records()voidregenerate(org.bukkit.command.CommandSender sender, MazeRecord record, long seed) voidregenerate(org.bukkit.command.CommandSender sender, MazeRecord record, long seed, boolean repair) voidreleaseChunk(org.bukkit.Chunk chunk) booleansafeDestination(org.bukkit.Location location) selection(org.bukkit.entity.Player player) voidsetSpawn(org.bukkit.entity.Player player, MazeRecord record, org.bukkit.Location location) voidvalidatePreview(String name, org.bukkit.World world, Bounds bounds, int cells) org.bukkit.Worldworld(MazeRecord record)
-
Constructor Details
-
MazeService
- Throws:
Exception
-
-
Method Details
-
records
-
activeOperationCount
public int activeOperationCount() -
operationListener
-
operation
-
currentOperation
-
progressPercent
-
holdChunk
public void holdChunk(org.bukkit.Chunk chunk) -
releaseChunk
public void releaseChunk(org.bukkit.Chunk chunk) -
require
-
busy
-
selection
- Throws:
Exception
-
world
-
authorize
-
validatePreview
-
create
-
regenerate
-
regenerate
public void regenerate(org.bukkit.command.CommandSender sender, MazeRecord record, long seed, boolean repair) -
delete
-
cancel
-
progress
-
entrance
-
destination
-
safeDestination
public boolean safeDestination(org.bukkit.Location location) -
setSpawn
public void setSpawn(org.bukkit.entity.Player player, MazeRecord record, org.bukkit.Location location) -
at
-
protectedAt
public boolean protectedAt(org.bukkit.Location location) -
mobSpawnBlockedAt
public boolean mobSpawnBlockedAt(org.bukkit.Location location) -
close
public void close()
-