Class RunStatusService

java.lang.Object
dev.deepcore.challenge.session.RunStatusService

public final class RunStatusService extends Object
Coordinates run progress sampling and action-bar status rendering.
  • Constructor Details

    • RunStatusService

      public RunStatusService(RunProgressService runProgressService, RunUiFormattingService runUiFormattingService, DeepCoreLogger log)
      Creates a run status service.
      Parameters:
      runProgressService - run milestone progress tracker
      runUiFormattingService - run time/label formatting service
      log - 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 participant
      onlineParticipants - currently online challenge participants
      now - current timestamp in milliseconds
      runningPhase - 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 participants
      now - current timestamp in milliseconds
      runningPhase - 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 milliseconds
      accumulatedPausedMillis - total paused duration in milliseconds
      pausedPhase - whether the session is currently paused
      pausedStartedMillis - current pause start timestamp in milliseconds
      Returns:
      action-bar component with objective and elapsed time text