Delete world on shutdown?

Discussion in 'Plugin Development' started by kaskoepoes112, Jun 17, 2014.

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

    kaskoepoes112

    Hi,
    I'm currently working on a minigame plugin. The intention is that when the server restarts it automatically generates a new world and deletes the old one (Including the player.dat files and the other stuff).
    I have no idea how to do this, I used google but none of them worked.
    Can anyone explain me how to do this?
     
  2. Offline

    PluginStudios

    kaskoepoes112 first, I think you should put it in the onDisable method for your plugin. I looked at google and found how to delete a world, not sure if it works. Basically this unloads the world so nobody can be on it, then finds it and removes it.
    Code:
      this.getServer().unloadWorld("world", true);
            File world_files = new File("world/");
            world_files.delete();
    
    Then, create a world.
    http://jd.bukkit.org/rb/doxygen/d3/d60/classorg_1_1bukkit_1_1WorldCreator.html
     
Thread Status:
Not open for further replies.

Share This Page