Resetting a world

Discussion in 'Plugin Development' started by AstramG, Jun 27, 2013.

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

    AstramG

    Hello! I was wondering how to restart a world? I am currently using BungeeCord for minigames, and I remove all the players from the server but how do I reset the broken blocks after that? I was thinking about copying the world folder, but I have no idea how to do that. Code is appreciated.
     
  2. Offline

    Ivan

    Restarting the server, and removing the world folder and copying a new one over.
     
  3. Offline

    AstramG

    How could I do this?

    Any help?

    Also, I forgot to mention. I'm trying to do this without server restarts.

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

    dillyg10

    Ok, it's like this:

    -> kick all the players
    -> Bukkit.unloadWorld(world);
    -> go through all the files in all the folders in the world folder, and delete tem
    -> create the new world. (Bukkit.createWorld());
     
  5. Offline

    Minnymin3

    Also make sure that you make the players unable to log-in until this completes (use PlayerLoginEvent)
     
  6. Offline

    AstramG

    I don't want a completely new world I want the same one as before but the unedited version that I saved.
     
  7. Offline

    Paper

    Bukkit.createWorld() loads a world from the server folder, or if it doesn't exist it creates one.
     
  8. Offline

    WhizZz

    You can stack the blocks the players break in an array and place them back with the array or something like that :p
     
  9. Offline

    skipperguy12

Thread Status:
Not open for further replies.

Share This Page