MonkaPszenna

Untitled

Nov 27th, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Countdown countdownCooldown = new Countdown(720) {
  2. @Override
  3. protected void onTick() {
  4.  
  5. PlayerCache cache = PlayerCache.getCache(event.getPlayer());
  6. cache.setTimeLeft(this.getCountdownSeconds());
  7.  
  8. System.out.println("Cooldown for " + event.getPlayer().getName() + " time left: " + cache.getTimeLeft());
  9.  
  10. }
  11.  
  12. @Override
  13. protected void onEnd() {
  14.  
  15. PlayerCache cache = PlayerCache.getCache(event.getPlayer());
  16.  
  17. cache.setCooldown(false);
  18. cache.setTimeLeft(0);
  19. }
  20.  
  21. };
  22.  
  23. countdownCooldown.launch();
Advertisement
Add Comment
Please, Sign In to add comment