Package dev.deepcore.challenge.session
Class RunPauseResumeService
java.lang.Object
dev.deepcore.challenge.session.RunPauseResumeService
Coordinates pause/resume lifecycle transitions for an active run.
-
Constructor Summary
ConstructorsConstructorDescriptionRunPauseResumeService(SessionState sessionState, Supplier<WorldResetManager> worldResetManagerSupplier, DeepCoreLogger log, Supplier<List<org.bukkit.entity.Player>> onlineParticipantsSupplier, Runnable clearPausedSnapshots, Consumer<org.bukkit.entity.Player> stashRunStateForLobby, PausedRunStateService pausedRunStateService, ActionBarTickerService actionBarTickerService, TaskGroup taskGroup, String degradingTaskKey, Runnable clearActionBar, PrepAreaService prepAreaService, ChallengeManager challengeManager, Runnable startActionBarTask, Runnable resumeDegradingInventoryTask) Creates a run pause/resume service. -
Method Summary
Modifier and TypeMethodDescriptionbooleanpause(org.bukkit.command.CommandSender sender, boolean announceBroadcast) Pauses the active run and snapshots participant state when allowed.booleanresume(org.bukkit.command.CommandSender sender) Resumes a paused run and restores participant state and tasks.
-
Constructor Details
-
RunPauseResumeService
public RunPauseResumeService(SessionState sessionState, Supplier<WorldResetManager> worldResetManagerSupplier, DeepCoreLogger log, Supplier<List<org.bukkit.entity.Player>> onlineParticipantsSupplier, Runnable clearPausedSnapshots, Consumer<org.bukkit.entity.Player> stashRunStateForLobby, PausedRunStateService pausedRunStateService, ActionBarTickerService actionBarTickerService, TaskGroup taskGroup, String degradingTaskKey, Runnable clearActionBar, PrepAreaService prepAreaService, ChallengeManager challengeManager, Runnable startActionBarTask, Runnable resumeDegradingInventoryTask) Creates a run pause/resume service.- Parameters:
sessionState- session phase and timing stateworldResetManagerSupplier- supplier for world reset managerlog- logger used for pause/resume feedbackonlineParticipantsSupplier- supplier for online run participantsclearPausedSnapshots- action to clear paused-run snapshotsstashRunStateForLobby- action that snapshots a player's run state for lobby transferpausedRunStateService- paused-run snapshot state serviceactionBarTickerService- action-bar ticker servicetaskGroup- task group managing scheduled run tasksdegradingTaskKey- task key for degrading inventory tickerclearActionBar- action to clear all action barsprepAreaService- prep border servicechallengeManager- challenge manager for component checksstartActionBarTask- action that starts action-bar tickingresumeDegradingInventoryTask- action that restarts degrading inventory ticker
-
-
Method Details
-
pause
public boolean pause(org.bukkit.command.CommandSender sender, boolean announceBroadcast) Pauses the active run and snapshots participant state when allowed.- Parameters:
sender- command sender requesting pauseannounceBroadcast- true to log and broadcast pause initiation- Returns:
- true when pause transition was applied
-
resume
public boolean resume(org.bukkit.command.CommandSender sender) Resumes a paused run and restores participant state and tasks.- Parameters:
sender- command sender requesting resume- Returns:
- true when resume transition was applied
-