Guest User

Untitled

a guest
Jul 5th, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. private int round = 1;
  2. private int seconds = 61;
  3.  
  4. public void start() {
  5. runTaskTimer(Test.getInstance(), 0L, 20L);
  6. }
  7.  
  8. public void stop() {
  9. cancel();
  10. }
  11.  
  12.  
  13. public void run() {
  14. if (this.seconds == 0) {
  15. if (this.round == 5) {
  16. Bukkit.broadcastMessage(Epidemic.getInstance().getPrefix() + "§cSpiel vorbei.");
  17. stop();
  18.  
  19. } else {
  20. this.round++;
  21. this.seconds = 61;
  22.  
  23. Bukkit.broadcastMessage(Epidemic.getInstance().getPrefix() + "Die Runde §e" + this.round + " §7ist vorbei!");
  24.  
  25. //Now there should be a 10 second break before the next round begins
  26.  
  27.  
  28. }
  29. } else {
  30. switch (seconds) {
  31. case 120: case 60: case 30: case 20: case 10: case 5: case 4: case 3: case 2: case 1:
  32. Bukkit.broadcastMessage(Epidemic.getInstance().getPrefix() + "Die Runde ist vorbei in §e" + this.seconds + " §eSekunden§7!");
  33. break;
  34. }
  35.  
  36. this.seconds--;
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment