Guest User

Untitled

a guest
Jun 29th, 2021
14
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package hiti.cooldown;
  2.  
  3. import com.google.common.collect.*;
  4.  
  5. public class CooldownManager {
  6.  
  7. public static TreeBasedTable<String, String, Cooldown> accs;
  8.  
  9. public static void createCooldown(final String playerName, final String name, final long time) {
  10. final Cooldown c = new Cooldown(playerName.toLowerCase(), name, time);
  11. CooldownManager.accs.put(playerName.toLowerCase(), name, c);
  12. }
  13.  
  14. public static boolean hasCdw(String playerName, String name) {
  15. final Cooldown c = CooldownManager.accs.get(playerName.toLowerCase(), name);
  16. if (c == null) {
  17. return true;
  18. }
  19. if (c.isLeft()) {
  20. CooldownManager.accs.remove(playerName.toLowerCase(), name);
  21. return false;
  22. }
  23. return true;
  24. }
  25.  
  26. public static long getLeftTime(final String playerName, final String name) {
  27. return ((Cooldown) CooldownManager.accs.get((Object) playerName.toLowerCase(), (Object) name)).getLeftTime();
  28. }
  29. }
RAW Paste Data