Class CommandCooldown

java.lang.Object
com.booksaw.betterTeams.cooldown.CommandCooldown
Direct Known Subclasses:
CooldownManager.NoCooldown

public class CommandCooldown extends Object
  • Constructor Details

    • CommandCooldown

      public CommandCooldown(String command, int cooldown)
      Used within cooldown manager to track a new commands cooldown
      Parameters:
      command - the reference for the command
      cooldown - how long of a cooldown that command has (in seconds)
  • Method Details

    • runCommand

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

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

      public int getCooldown()
    • getCommand

      public String getCommand()