@Override public void run() { final Set<Player> tributes = game.getTributes(); while (time > 0) { if (time < 11 || time % 10 == 0) { for (Player p : tributes) { p.sendMessage(prefix + GREEN + "The game begins in " + time + " seconds!"); } } try { Thread.sleep(1000); } catch (Exception wtf) { wtf.printStackTrace(); } time--; } Bukkit.getServer() .broadcastMessage( prefix + YELLOW + "A game has begun in arena " + BLUE + game.getArena().getName() + "!"); for (Player p : tributes) { p.sendMessage(prefix + GREEN + "May the odds be ever in your favor!"); } game.startGame(); }
public void prepareTributes() { Collection<Location> spawns = game.getArena().getWarps().getSpawns().values(); Set<Player> tributes = game.getTributes(); Iterator<Location> i = spawns.iterator(); String list = prefix + GREEN + "Tributes: "; for (Player p : tributes) { list += RED + p.getName() + WHITE + ", "; p.teleport(i.next()); Players.clearInv(p); Players.heal(p); } list = list.substring(0, list.length() - 2); for (Player p : tributes) { p.sendMessage(prefix + GREEN + "The countdown has begun!"); p.sendMessage(list); } }