Package com.booksaw.betterTeams.cooldown
Class CommandCooldown
java.lang.Object
com.booksaw.betterTeams.cooldown.CommandCooldown
- Direct Known Subclasses:
CooldownManager.NoCooldown
-
Constructor Summary
ConstructorsConstructorDescriptionCommandCooldown
(String command, int cooldown) Used within cooldown manager to track a new commands cooldown -
Method Summary
Modifier and TypeMethodDescriptionint
int
getRemaining
(org.bukkit.entity.Player player) Used to get how long a player has remaining on the cooldown (to the nearest second)void
runCommand
(org.bukkit.entity.Player player) Run when a player runs the command to track when they can next run the command
-
Constructor Details
-
CommandCooldown
Used within cooldown manager to track a new commands cooldown- Parameters:
command
- the reference for the commandcooldown
- 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
-