Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- public class Broadcaster implements Runnable {
- private static int timeUntilStart;
- public void run() {
- timeUntilStart = 60;
- while (true) {
- int PlayersOnline = Bukkit.getOnlinePlayers().length;
- for(;timeUntilStart >= 0; timeUntilStart--) {
- if ( timeUntilStart == 0 && PlayersOnline > 17) {
- //TODO START GAME
- break;
- }
- }
- if (timeUntilStart % 10 == 0 || timeUntilStart < 10) {
- Bukkit.broadcastMessage(ChatColor.GOLD + "[" + ChatColor.DARK_RED + "Survival Games" + ChatColor.GOLD + "]" + "Mancano" + timeUntilStart + "secondi fino alla fine della" + GameStates.currentStates );
- }
- try{
- Thread.sleep(1000);
- }catch(InterruptedException e) {
- e.printStackTrace();
- Bukkit.shutdown();
- }
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement