Class CooldownManager.Cooldown

java.lang.Object
me.mehboss.utils.CooldownManager.Cooldown
Enclosing class:
CooldownManager

public static class CooldownManager.Cooldown extends Object
Represents a cooldown timer for a specific recipe.

A cooldown consists of:

  • The recipe ID
  • The cooldown duration (seconds)
  • The timestamp when the cooldown started
  • Constructor Details

    • Cooldown

      public Cooldown(String recipeID, long durationSeconds)
      Creates a new cooldown timer starting immediately.
      Parameters:
      recipeID - The recipe to restrict.
      durationSeconds - Duration in seconds.
  • Method Details

    • getRecipeID

      public String getRecipeID()
      Returns:
      The recipe ID this cooldown belongs to.
    • getDuration

      public long getDuration()
      Returns:
      The cooldown duration in seconds.
    • getStartTime

      public long getStartTime()
      Returns:
      The timestamp when the cooldown began (ms).
    • getTimeLeft

      public long getTimeLeft()
      Calculates how many seconds remain.
      Returns:
      Seconds left, never negative.
    • isExpired

      public boolean isExpired()
      Checks whether the cooldown has completed.
      Returns:
      true if expired, else false.