Solved Creates a new world

Discussion in 'Plugin Development' started by k1nq, Aug 3, 2020.

  1. Offline

    k1nq

    SO:

    I created a command (/statik save <world>) which saves a copy of <world> and can be loaded by using the commands (/statik load <save>). The save will still be available even when the world is deleted. Anyways, that's not the problem, and that ^^ works perfectly fine. The problem is though, that it checks if the world exists (when loading the save) and deletes it if it does exist. It then makes a new folder and copies the files from the save into that folder. Then it imports it using this code:
    Code:
    Bukkit.getServer().createWorld(new WorldCreator(args[1]));
    Now that, also works fine! But when loading a save of a nether world, it creates a completely new world instead of simply loading the already existing file! How do I fix this?
     
  2. Offline

    Banjer_HD

    Try Bukkit.getServer().getWorlds().add(worldname);
     
  3. Offline

    k1nq

    Nevermind, I think I fixed it!
    For those who come to this thread later and wonder how I did it, I simply created a new WorldCreator object and set the environment to nether by doing:
    Code:
    worldcreator.environment(Environment.NETHER);
    and that seems to have simply loaded the world instead of making a new one.
     

Share This Page