36 lines
987 B
Java
36 lines
987 B
Java
/*
|
|
* Copyright (c) univento.eu 2016. Any attempt to use these program(s) without permission may result in a penalty of up to 1.000€
|
|
*/
|
|
|
|
package eu.univento.woolget.game;
|
|
|
|
import eu.univento.core.api.server.Servers;
|
|
import eu.univento.core.api.Utils;
|
|
import eu.univento.core.api.server.ServerSettings;
|
|
import eu.univento.woolget.WoolGet;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 0.1
|
|
*/
|
|
public class RestartCounter extends BukkitRunnable{
|
|
|
|
int time = 10;
|
|
|
|
public void run() {
|
|
if(WoolGet.getGameStage() == GameStage.Restart) {
|
|
|
|
Bukkit.broadcastMessage("§6Server startet neu in " + time + " Sekunden");
|
|
|
|
if(time == 0) {
|
|
Bukkit.getScheduler().cancelTask(WoolGet.restartID);
|
|
Utils.restart();
|
|
ServerSettings.setPlayedGame(null);
|
|
Servers.connectAllToServer("Lobby01");
|
|
}
|
|
time--;
|
|
}
|
|
}
|
|
} |