Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cadedev.skywars.countdown;
- import de.cadedev.skywars.SkyWars;
- import org.bukkit.Bukkit;
- public class Missing_Countdown {
- public boolean isRunning = false;
- public int id;
- public void onStart() {
- isRunning = true;
- id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SkyWars.getInstance(), () -> {
- int missing = SkyWars.getInstance().MIN_PLAYERS - SkyWars.getInstance().playing_lobby.size();
- Bukkit.getOnlinePlayers().forEach((all) -> SkyWars.getInstance().getMethods().sendActionBar(all,"§7Mindestens §c" + missing + " §7Spieler sind zum §aStarten §7erforderlich"));
- }, 0, 1 * 20);
- }
- public void onStop() {
- if (isRunning == true) {
- isRunning = false;
- Bukkit.getScheduler().cancelTask(id);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement