Class Cooldown<T>


  • public class Cooldown<T>
    extends java.lang.Object
    An easy to use Cooldown class
    • Constructor Summary

      Constructors 
      Constructor Description
      Cooldown​(long time)
      Instantiates a new Cooldown.
    • Method Summary

      Modifier and Type Method Description
      void addToCooldown​(T player)
      Add the player to the cooldown
      long getSecondsRemaining​(T player)
      Get the remaining seconds
      long getTimeRemaining​(T player)
      Get the remaining time
      boolean isCooledDown​(T player)
      Gets if the player's cooldown is over
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cooldown

        public Cooldown​(long time)
        Instantiates a new Cooldown.
        Parameters:
        time - the time in milliseconds
    • Method Detail

      • addToCooldown

        public void addToCooldown​(T player)
        Add the player to the cooldown
        Parameters:
        player - the player
      • getTimeRemaining

        public long getTimeRemaining​(T player)
        Get the remaining time
        Parameters:
        player - the player
        Returns:
        time remaining
      • getSecondsRemaining

        public long getSecondsRemaining​(T player)
        Get the remaining seconds
        Parameters:
        player - the player
        Returns:
        time remaining
      • isCooledDown

        public boolean isCooledDown​(T player)
        Gets if the player's cooldown is over
        Parameters:
        player - the player
        Returns:
        boolean