Stop world from saving on shutdown?

Discussion in 'Plugin Development' started by stuntguy3000, Apr 19, 2013.

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

    stuntguy3000

    Hi,

    This has been bugging me. Essentially, i want a world's edits to not be saved and for it to restore to what it was before. I have a code that does this, however when the server shut down it saves the edits. Is there a way i can stop the shut down process from saving the world, or, make my code run before it does that?
     
  2. See world.setAutoSave(), I'm not sure if it prevents worlds from being saved on shutdown.
     
  3. Offline

    stuntguy3000

    Prob not, il give it a shot.

    Nope.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  4. Offline

    stuntguy3000

    So I guess you could unload the world in onDisable() to prevent it from being saved...

    I found the world saves before my plugin gets a chance to fire onDisable .-.
     
  5. I've just tested setAutoSave() and apparently it does not save the world after I shut down the server, any change that I made was reverted.

    Also onDisable() does trigger before worlds are saved, confirmed by server log.

    So I really don't know what you've tested but you're getting wrong results.

    The only thing that was saved was player's inventory which is not dependant on the world because it's server-wide.
     
  6. Offline

    stuntguy3000

    "Also onDisable() does trigger before worlds are saved, confirmed by server log."

    Busted by my server log.
     
Thread Status:
Not open for further replies.

Share This Page