Class CooldownManager

java.lang.Object
com.marcusslover.plus.lib.cooldown.CooldownManager

public class CooldownManager extends Object
Lets you easily manage player global cooldowns.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    check(@Nullable org.bukkit.entity.Player player, @NotNull String key, long duration)
    Checks if the player has a cooldown.
     
    static void
    remove(@Nullable org.bukkit.entity.Player player)
    Removes a cooldown for the player or global.
    static void
    set(@Nullable org.bukkit.entity.Player player, @NotNull String key, long duration)
    Sets a cooldown for the player or global.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static CooldownManager instance()