Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Befehl der gehen soll
- if(cmd.getName().equalsIgnoreCase("stoppen")){
- if(sender.hasPermission("mctools.stoppen")) {
- //if(args.length == 1){
- //StringBuilder stop = new StringBuilder();
- //for(String element : args)
- //{
- // if(stop.toString().length() != 0)stop.append(" ");
- //stop.append(element);
- //}
- //Bukkit.broadcastMessage("§6§lNeustart: §b" + stop.toString());
- onCountdown();// Unte drunter
- }
- }
- return false;//Oncommand Methoden Schluss
- }
- public void onCountdown() {
- this.scheduler = Bukkit.getScheduler();
- taskid = this.scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
- @Override
- public void run() {
- int count = 200;
- if(count == 20) {
- Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
- }
- if(count == 10) {
- Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
- }
- if(count < 6) {
- Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
- }
- if(count == 0) {
- scheduler.cancelTask(taskid);
- Bukkit.shutdown();
- }
- count -= 1;
- }
- }
- , 0L, 20L);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement