Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1.  
  2. public static int timer = 00;
  3. public static int minutes = 00;
  4. public static int hours = 00;
  5.  
  6. }
  7. public static void startTimerPlus(Player p) {
  8. Main.state = GameStates.CHALLENGE;
  9.  
  10. taskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
  11.  
  12.  
  13. @Override
  14. public void run() {
  15.  
  16. if(Settings.timer <= 10) {
  17. String msg = "§2Zeit: §6" + Settings.hours + "§2:§6" + Settings.minutes + "§2:§06" + Settings.timer;
  18. for(Player all : Bukkit.getOnlinePlayers()) {
  19. all.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
  20. }
  21. } else {
  22. String msg = "§2Zeit: §6" + Settings.hours + "§2:§6" + Settings.minutes + "§2:§6" + Settings.timer;
  23. for(Player all : Bukkit.getOnlinePlayers()) {
  24. all.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(msg));
  25. }
  26. }
  27.  
  28. if(Settings.timerrun == true) {
  29. if(Settings.timer == 59) {
  30. Settings.timer = 0;
  31. Settings.minutes ++;
  32. } else if(Settings.minutes == 59) {
  33. Settings.minutes = 0;
  34. Settings.hours ++;
  35. }
  36. Settings.timer ++;
  37. } else {
  38.  
  39. }
  40. }
  41.  
  42.  
  43.  
  44. }, 0L, 20L);
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement