Class CooldownManager.NoCooldown

java.lang.Object
com.booksaw.betterTeams.cooldown.CommandCooldown
com.booksaw.betterTeams.cooldown.CooldownManager.NoCooldown
Enclosing class:
CooldownManager

public static class CooldownManager.NoCooldown extends CommandCooldown
This class is returned when a command does not have a cooldown, this is used to avoid running many null checks throughout the program. The class is used to stop any cooldown tracking for a specific command
Author:
booksaw
  • Constructor Details

    • NoCooldown

      public NoCooldown()
  • Method Details

    • runCommand

      public void runCommand(org.bukkit.entity.Player player)
      Description copied from class: CommandCooldown
      Run when a player runs the command to track when they can next run the command
      Overrides:
      runCommand in class CommandCooldown
      Parameters:
      player - the player to add a cooldown for
    • getRemaining

      public int getRemaining(org.bukkit.entity.Player player)
      Description copied from class: CommandCooldown
      Used to get how long a player has remaining on the cooldown (to the nearest second)
      Overrides:
      getRemaining in class CommandCooldown
      Parameters:
      player - the player to test the cooldown length for
      Returns:
      how long they have remaining (returns -1 if they can run the command)