Saving server?

Discussion in 'Plugin Development' started by firecombat4, Mar 17, 2012.

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

    firecombat4

    Hello, so ive been watching new bostons tutorials which are amazing (at part 18 now) but i decided to come and actually check plugin development out, for my first plugin i want to automatically save the server at a time defined in config.
    So just wondering how i would actually save the server, thanks!
     
  2. Offline

    Njol

    To save all worlds & players to disk you can use this:

    for (World w:Bukkit.getWorlds()) {
    w.save();
    }
    Bukkit.savePlayers();

    But remember that the worlds are saved automatically every few seconds, so this won't have any effect other than sloving the server down. You can however deactivate the auto saves using this:

    for (World w:Bukkit.getWorlds())
    w.setAutoSave(false)

    PS: I couldn't use [code] tags because they don't allow links.
     
  3. Offline

    firecombat4

    Oh i suppose its pointless if it automatically saves anyway, i thought it only saved hourly.
    Thanks anyway!
     
Thread Status:
Not open for further replies.

Share This Page