Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time = delay;
- final String totalTime = PhaseManager.timeString(gameTime);
- taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin,
- new Runnable() {
- @Override
- public void run() {
- if (time <= 1) {
- for(Player p : Bukkit.getOnlinePlayers()) {
- p.performCommand("/hub");
- }
- }
- if (time <= 0) {
- Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "restart");
- plugin.reset();
- stop();
- return;
- }
- String message = ChatColor.GOLD + "Totalni cas: "
- + ChatColor.WHITE + totalTime + ChatColor.YELLOW + "" + ChatColor.BOLD + " > "
- + ChatColor.GREEN + "Restartuji za "
- + time;
- float percent = (float) time / (float) delay;
- for (Player p : Bukkit.getOnlinePlayers())
- BarUtil.setMessageAndPercent(p, message, percent);
- time--;
- }
- }, 0L, 20L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement