Class CooldownManager
java.lang.Object
com.marcusslover.plus.lib.cooldown.CooldownManager
Lets you easily manage player global cooldowns.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the player has a cooldown.static CooldownManagerinstance()static voidremove(@Nullable org.bukkit.entity.Player player) Removes a cooldown for the player or global.static voidSets a cooldown for the player or global.
-
Method Details
-
check
public static boolean check(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String key, long duration) Checks if the player has a cooldown.- Parameters:
player- The player to check or null if global.key- The cooldown key.duration- The duration of the cooldown in milliseconds.- Returns:
- true if no cooldown, false if cooldown.
-
set
public static void set(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String key, long duration) Sets a cooldown for the player or global.- Parameters:
player- The player to set the cooldown for or null if global.key- The cooldown key.duration- The duration of the cooldown in milliseconds.
-
remove
public static void remove(@Nullable @Nullable org.bukkit.entity.Player player) Removes a cooldown for the player or global.- Parameters:
player- The player to remove the cooldown for or null if global.
-
instance
-