Class Cooldown

java.lang.Object
com.Moshu.Misc.Cooldown

public class Cooldown extends Object
  • Field Details

    • cooldowns

      public static Map<String,Long> cooldowns
    • plugin

      public static Main plugin
  • Constructor Details

    • Cooldown

      public Cooldown(Main plugin)
    • Cooldown

      public Cooldown(UUID uuid, String name, int seconds)
      Easily set cooldowns for anything
      Parameters:
      uuid - , the player's uuid
      name - , the cooldown's name
      seconds - , the time in seconds for the cooldown
  • Method Details

    • set

      public void set()
      Sets the cooldown as active
    • has

      public boolean has()
      Checks if the player has an active cooldown of this type
      Returns:
      true/false
    • remove

      public void remove()
      Removes the cooldown if the time ran up
    • getName

      public String getName()
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
    • getUUID

      public UUID getUUID()
    • getSeconds

      public int getSeconds()
    • getMinutes

      public int getMinutes()
    • getHours

      public int getHours()
    • getDays

      public int getDays()
    • remainingTime

      public int remainingTime()
      Get remaining time
      Returns:
      remaining time in minutes
    • error

      public void error()
      Sends an error message to the player.
    • setCooldowns

      public static void setCooldowns(UUID uuid, String name, int seconds)
      This can be used for every case, while the old method works only for Kits.
      Parameters:
      uuid - player's uuid
      name - cooldown name
      seconds - the cooldown time in seconds
    • hasCooldown

      public static boolean hasCooldown(UUID uuid, String name)
      Parameters:
      uuid - the player's uuid
      name - cooldown name
      Returns:
      true if the player has a cooldown active and false if he doesn't
    • getRemainingTime

      public static double getRemainingTime(UUID uuid, String kit)
      Parameters:
      uuid - player's uuid
      kit - the kit you want to get the cooldown of
      Returns:
      the remaining cooldown in hours
    • getRemainingTimeMinutes

      public static int getRemainingTimeMinutes(UUID uuid, String name)
      Parameters:
      uuid - player's uuid
      name - the cooldown you want to get the cooldown of
      Returns:
      the remaining cooldown in minutes
    • getRemainingTimeSeconds

      public static int getRemainingTimeSeconds(UUID uuid, String name)