Package dev.deepcore.challenge.session
Class RunStatusService
java.lang.Object
dev.deepcore.challenge.session.RunStatusService
Coordinates run progress sampling and action-bar status rendering.
-
Constructor Summary
ConstructorsConstructorDescriptionRunStatusService(RunProgressService runProgressService, RunUiFormattingService runUiFormattingService, DeepCoreLogger log) Creates a run status service. -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentbuildRunActionBarMessage(long runStartMillis, long accumulatedPausedMillis, boolean pausedPhase, long pausedStartedMillis) Builds the current run action-bar message for participants.voidonParticipantWorldChanged(org.bukkit.World.Environment environment, List<org.bukkit.entity.Player> onlineParticipants, long now, boolean runningPhase) Updates run progress from a participant world-change event.voidreset()Resets run-status transient tracking values.voidtickProgressFromParticipants(List<org.bukkit.entity.Player> onlineParticipants, long now, boolean runningPhase) Samples participant progress and updates milestone tracking for the current tick.
-
Constructor Details
-
RunStatusService
public RunStatusService(RunProgressService runProgressService, RunUiFormattingService runUiFormattingService, DeepCoreLogger log) Creates a run status service.- Parameters:
runProgressService- run milestone progress trackerrunUiFormattingService- run time/label formatting servicelog- challenge logger for player/admin messaging
-
-
Method Details
-
reset
public void reset()Resets run-status transient tracking values. -
onParticipantWorldChanged
public void onParticipantWorldChanged(org.bukkit.World.Environment environment, List<org.bukkit.entity.Player> onlineParticipants, long now, boolean runningPhase) Updates run progress from a participant world-change event.- Parameters:
environment- world environment entered by the participantonlineParticipants- currently online challenge participantsnow- current timestamp in millisecondsrunningPhase- whether the session is actively running
-
tickProgressFromParticipants
public void tickProgressFromParticipants(List<org.bukkit.entity.Player> onlineParticipants, long now, boolean runningPhase) Samples participant progress and updates milestone tracking for the current tick.- Parameters:
onlineParticipants- currently online challenge participantsnow- current timestamp in millisecondsrunningPhase- whether the session is actively running
-
buildRunActionBarMessage
public net.kyori.adventure.text.Component buildRunActionBarMessage(long runStartMillis, long accumulatedPausedMillis, boolean pausedPhase, long pausedStartedMillis) Builds the current run action-bar message for participants.- Parameters:
runStartMillis- run start timestamp in millisecondsaccumulatedPausedMillis- total paused duration in millisecondspausedPhase- whether the session is currently pausedpausedStartedMillis- current pause start timestamp in milliseconds- Returns:
- action-bar component with objective and elapsed time text
-