CooldownManager

Keeps ability cooldown end times in memory, separately for each player.

Functions

Link copied to clipboard
fun clearAllCooldowns(playerUUID: UUID?)

Removes all cooldowns for the player.

Link copied to clipboard
fun clearCooldown(playerUUID: UUID?, key: String?)

Removes one ability cooldown for the player.

Link copied to clipboard

Returns the player's active ability cooldowns and their remaining whole seconds.

Link copied to clipboard
fun getCooldownTimeLeft(playerUUID: UUID?, key: String?): Long

Returns whole seconds left, or zero if there is no active cooldown.

Link copied to clipboard
fun isOnCooldown(playerUUID: UUID?, key: String?): Boolean

Returns whether the player has time left on the cooldown.

Link copied to clipboard
fun setCooldown(playerUUID: UUID?, key: String?, seconds: Long)

Starts a cooldown for the player and ability ID.