Stop The Server

Discussion in 'Plugin Development' started by Alvarez96, Feb 15, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Alvarez96

    Hey there. I was just wondering how I can do the following:

    • Make the server save-all
    • And shut itself down
    All from the plugin code.
    Thanks in advanced for the help :)
     
  2. Offline

    jamietech

    Code:
    for (World w : this.getServer().getWorlds()) {
    w.save();
    }
    this.getServer().savePlayers();
    for (Player p : this.getServer().getOnlinePlayers()) {
    p.kickPlayer("Server shutting down!");
    }
    this.getServer().shutdown();
     
  3. Offline

    Alvarez96

    TYVM ill try it out later.:)
     
Thread Status:
Not open for further replies.

Share This Page