Package com.booksaw.betterTeams.cooldown
Class CooldownManager.NoCooldown
java.lang.Object
com.booksaw.betterTeams.cooldown.CommandCooldown
com.booksaw.betterTeams.cooldown.CooldownManager.NoCooldown
- Enclosing class:
- CooldownManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
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 commandMethods inherited from class com.booksaw.betterTeams.cooldown.CommandCooldown
getCommand, getCooldown
-
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 classCommandCooldown
- 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 classCommandCooldown
- Parameters:
player
- the player to test the cooldown length for- Returns:
- how long they have remaining (returns -1 if they can run the command)
-