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.
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.
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());
Also make sure that you make the players unable to log-in until this completes (use PlayerLoginEvent)
I don't want a completely new world I want the same one as before but the unedited version that I saved.
You can stack the blocks the players break in an array and place them back with the array or something like that