Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. package de.cadedev.skywars.countdown;
  2.  
  3. import de.cadedev.skywars.SkyWars;
  4. import org.bukkit.Bukkit;
  5.  
  6. public class Missing_Countdown {
  7.  
  8. public boolean isRunning = false;
  9. public int id;
  10.  
  11. public void onStart() {
  12.  
  13. isRunning = true;
  14.  
  15. id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SkyWars.getInstance(), () -> {
  16.  
  17. int missing = SkyWars.getInstance().MIN_PLAYERS - SkyWars.getInstance().playing_lobby.size();
  18. Bukkit.getOnlinePlayers().forEach((all) -> SkyWars.getInstance().getMethods().sendActionBar(all,"§7Mindestens §c" + missing + " §7Spieler sind zum §aStarten §7erforderlich"));
  19.  
  20. }, 0, 1 * 20);
  21.  
  22. }
  23.  
  24. public void onStop() {
  25.  
  26. if (isRunning == true) {
  27.  
  28. isRunning = false;
  29. Bukkit.getScheduler().cancelTask(id);
  30.  
  31. }
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement