Loading from a yml file a world

Discussion in 'Plugin Development' started by Debels, Dec 28, 2012.

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

    Debels

    How can I load a world from a yml file?, I try loading it as a string and then converting it to a world, but that fails badly :/, suggestions?
     
  2. Offline

    jojohnson1

    what do you want to save in that file? Only the name of the world or also all region data etc?
     
  3. Offline

    Debels

    I'm saving the players location, Meaning: World, x, y, z, pitch and yaw

    anyone?

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

    ImDeJay

    can you do something like

    Code:
    if(player.getWorld().equals("worldName")){
    player.getLocation().setX(blah);
    player.getLocation().setY(blah);
    player.getLocation().setZ(blah);
    player.getLocation().setPitch(blah);
    player.getLocation().setYaw(blah);
    }
    of course, getting all the information from the .yml


    or on player join, get information from the .yml then do the same except also do

    player.setWorld(blah);
     
  5. Offline

    Debels

    i know I can do the equals(stuff), but I would have to guess whats the name of the world .
     
  6. Offline

    ImDeJay

    when are you reading/setting this information?

    on player join or when they type a command or what?
     
  7. Offline

    raGan.

    Code:
    World world = Bukkit.getServer().getWorld(someString);
    if(world == null) {
        // no such world
    }
     
  8. Offline

    Debels

    Thanks, that works perfectly
     
Thread Status:
Not open for further replies.

Share This Page