Load worlds

Discussion in 'Plugin Development' started by Poppi, May 5, 2013.

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

    Poppi

    Hello, I am here because of a simple question I cannot seem to get the answer too.

    I wondered about the easiest way to load multiple worlds on a plugin without having to use MultiVerse.
    I am creating a fully automatic gamemode and I'd like to have a simple user-friendly way to add more worlds and loading them.

    The reason I dont want to use Multiverse is simple, I want my plugin to not be dependant on other plugins at all.

    Thank you for your time and hopefully useful answers.
     
  2. Offline

    Poppi

    Bump ;)
     
  3. Offline

    Minecrell

  4. Offline

    Poppi

    I am, however hardcoding the map world name isn't helpful. What I was looking for was if you could for loop a stringlist or something.
    Minecrell
     
  5. Offline

    Minecrell

    Poppi You want to load worlds with the world name in a string list? You only have to loop through it and replace the string with the world name.
    Example:
    Code:java
    1. List<String> worlds = getConfig().getStringList("worlds");
    2. for (String worldName : worlds) {
    3. getServer().createWorld(new WorldCreator(worldName));
    4. }

    In this example every world in the config will be loaded or created if there is no world with such a name.
     
  6. Offline

    Poppi

    Thank you very much, I had forgot about storing the string list in a List<String> :)
     
Thread Status:
Not open for further replies.

Share This Page