Solved World Deletion / Replacement

Discussion in 'Spigot Plugin Development' started by Sulphate, May 30, 2017.

  1. Hello all,

    This is the first time I'm attempting something like this, I don't think it should be too hard but I can't find anything helpful online that's fairly recent.

    I want to know how I would make a copy of a world, then after a certain amount of time, delete the current world and replace it with the copied version, effectively resetting the world. Not looking to create a new world, it's a custom map.

    Any help appreciated.
  2. Look into the WorldCreator class.
  3. Use this, but I still presume you would need to load it as a world. Maybe not though, not sure.
    EDIT: Oh and also, before you delete the world folder, you have to unload it using World#unload, or else it won't erase the directory.
  4. Alright, thanks for the help guys, I'll look at both of those :)
    • Like Like x 1