Class Cooldown<K>

java.lang.Object
net.guizhanss.guizhanlib.common.Cooldown<K>
Type Parameters:
K - The type of key.

public final class Cooldown<K> extends Object
This class provides cooldown feature, based on keys.
Author:
ybw0014
  • Constructor Details

    • Cooldown

      public Cooldown()
  • Method Details

    • check

      public boolean check(K key)
      Query if the key can be used.
      Parameters:
      key - The key.
      Returns:
      Whether the key can be used.
    • set

      public void set(K key, long time)
      Set cooldown of key.
      Parameters:
      key - The key.
      time - The cooldown in milliseconds.