Class PrepCountdownService

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

public final class PrepCountdownService extends Object
Manages the prep-phase ready countdown task lifecycle.
  • Constructor Details

    • PrepCountdownService

      public PrepCountdownService(org.bukkit.plugin.java.JavaPlugin plugin)
      Creates a prep countdown service.
      Parameters:
      plugin - plugin used to schedule countdown tasks
  • Method Details

    • startCountdown

      public void startCountdown(int countdownSeconds, BooleanSupplier shouldCancel, Runnable onCancel, Runnable onComplete, IntConsumer onTick)
      Starts the prep countdown with tick, cancel, and completion callbacks.
      Parameters:
      countdownSeconds - initial countdown duration in seconds
      shouldCancel - predicate checked each tick for cancellation conditions
      onCancel - callback executed when countdown is canceled
      onComplete - callback executed when countdown reaches zero
      onTick - callback receiving each second remaining value
    • cancel

      public void cancel()
      Cancels the active countdown task if one is currently running.