Class Cooldown

java.lang.Object
dev.bouncingelf10.timelesslib.api.cooldown.Cooldown

public final class Cooldown extends Object
A single active cooldown, returned by ServerCooldownManager/ClientCooldownManager.
Unlike a Countdown, this is scoped to exactly what a cooldown needs - readiness, remaining time, progress, and resetting early - it does not expose tick/threshold/display machinery that doesn't make sense for a cooldown.
  • Method Details

    • isReady

      public boolean isReady()
      Returns:
      true if this cooldown has finished or been reset.
    • remaining

      public Duration remaining()
      Returns:
      remaining time before this cooldown is ready. Zero if already ready.
    • progress

      public double progress()
      Returns:
      progress from 0.0 (just started) to 1.0 (ready).
    • reset

      public void reset()
      Cancels this cooldown early, making it immediately ready.
    • onReady

      public Cooldown onReady(Runnable handler)
      Registers a callback to run once this cooldown becomes ready (naturally or via reset()).