Solved Load a world.

Discussion in 'Plugin Development' started by Eballer48, Sep 30, 2012.

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

    Eballer48

    I need to load an off world onEnable(), any help is appreciated.
     
  2. Offline

    Hertz

    try

    getServer().getWorlds().add(worldname);

    and

    if(getServer().getWorlds().add(worldname) == true)
    {
    System.out.println(worldname + "is loaded")
    }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  3. Offline

    Eballer48


    Code:
    Bukkit.getServer().getWorlds().add(WORLD);
     
    if(getServer().getWorlds().add(WORLD) == true) {
    log.info("Loaded world '" + WORLD_NAME + "' sucessfully!");
    }
    
    Didn't work. I got the debug message but when I try to teleport to the world I get the error because the world isn't loaded.
     
  4. Offline

    chaseoes Retired Staff

    .create(world)
     
  5. Offline

    Eballer48

    The world's already created just not loaded.
     
  6. Offline

    Jogy34

    Code:
    getServer().createWorld(new WorldCreator("WorldName");
    
    That returns a world that was either created or loaded if it already exists
     
    Eballer48 likes this.
  7. Offline

    Eballer48

    Yeah it does.. I don't need to create a world either the world already exist FFS, it just needs to be loaded so it may be used by the server. How do I go about doing this?
     
  8. Offline

    Jogy34

    That returns a world that was either created or loaded if it already exists
     
    MrBluebear3, ferrybig and Eballer48 like this.
  9. Offline

    Eballer48

    I thank you kindly sir :)
     
  10. Offline

    chaseoes Retired Staff

    If it already exists it's loaded. -.-
     
  11. Offline

    Jogy34

    Not necessarily. When you start a server only the main world is loaded and then you either have to force them to load or when a player is teleported to a different world from within the game (eg. nether portal or end portal) minecraft then loads the world. If there is a world that isn't loaded then you try to teleport a player to it from within a plugin then it won't work. I have run into this problem on multiple occasions.
     
    blue1 likes this.
  12. Offline

    chaseoes Retired Staff

    That's why you use the method I provided and explained in the post you quoted to load it..
     
  13. Offline

    Jogy34

    There is no .create(World) method. it's server.createWorld(WorldCreator) like I said.

    Also I never quoted any post by you that explained any method
     
  14. Offline

    chaseoes Retired Staff

    Close enough, autocomplete would have gotten it.

    You clearly quoted a post made by me in which I was quoting a post by someone who quoted a post of mine confused about what the method did.
     
  15. Offline

    Jogy34

    The post that I quoted was you saying: "If it already exists it's loaded. -.-" Which I then said was not always the case.
     
  16. Offline

    chaseoes Retired Staff

  17. Offline

    Sabersamus

  18. Offline

    Jogy34

    That is what I was thinking you were saying chaseoes , I get what you actually meant now though.
     
Thread Status:
Not open for further replies.

Share This Page