Advertisement
combo5

Befehl

Jun 10th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. //Befehl der gehen soll
  2. if(cmd.getName().equalsIgnoreCase("stoppen")){
  3. if(sender.hasPermission("mctools.stoppen")) {
  4.  
  5. //if(args.length == 1){
  6. //StringBuilder stop = new StringBuilder();
  7. //for(String element : args)
  8. //{
  9. // if(stop.toString().length() != 0)stop.append(" ");
  10. //stop.append(element);
  11. //}
  12. //Bukkit.broadcastMessage("§6§lNeustart: §b" + stop.toString());
  13. onCountdown();// Unte drunter
  14. }
  15. }
  16.  
  17.  
  18.  
  19.  
  20. return false;//Oncommand Methoden Schluss
  21. }
  22. public void onCountdown() {
  23. this.scheduler = Bukkit.getScheduler();
  24.  
  25. taskid = this.scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
  26. @Override
  27. public void run() {
  28. int count = 200;
  29. if(count == 20) {
  30. Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
  31. }
  32. if(count == 10) {
  33. Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
  34. }
  35. if(count < 6) {
  36. Bukkit.broadcastMessage(ChatColor.GREEN + "Server stoppt in: " + count);
  37. }
  38. if(count == 0) {
  39. scheduler.cancelTask(taskid);
  40. Bukkit.shutdown();
  41. }
  42. count -= 1;
  43. }
  44. }
  45. , 0L, 20L);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement