Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import org.bukkit.Bukkit;
  2. import org.bukkit.ChatColor;
  3.  
  4.  
  5. public class Broadcaster implements Runnable {
  6.     private static int timeUntilStart;
  7.  
  8.  
  9.     public void run() {
  10.         timeUntilStart = 60;
  11.         while (true) {
  12.             int PlayersOnline = Bukkit.getOnlinePlayers().length;
  13.             for(;timeUntilStart >= 0; timeUntilStart--) {
  14.                 if ( timeUntilStart == 0 && PlayersOnline > 17) {
  15.                     //TODO START GAME
  16.                     break;
  17.                 }
  18.        
  19.     }
  20. if (timeUntilStart % 10 == 0 || timeUntilStart < 10) {
  21. Bukkit.broadcastMessage(ChatColor.GOLD + "[" + ChatColor.DARK_RED + "Survival Games" + ChatColor.GOLD + "]" +  "Mancano" + timeUntilStart + "secondi fino alla fine della" + GameStates.currentStates );
  22. }
  23. try{
  24.     Thread.sleep(1000);
  25. }catch(InterruptedException e) {
  26.     e.printStackTrace();
  27.     Bukkit.shutdown();
  28.    
  29. }
  30. }
  31.     }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement