adding world info to config.yml

Discussion in 'Plugin Development' started by brittanybitsh, Jan 29, 2013.

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

    brittanybitsh

    my plugin lists the worlds in a list in config.yml but would i make it where you can add paths to the listed worlds?

    it look like this
    Code:
    worldslist:
    - world
    - world_nether
    - world_the_end
    but i want so set set spawn points for each world so it would
    Code:
    worldslist:
    - world:
        X:
        Y:
        Z:
        yaw:
        pitch:
    - world_nether:
        X:
        Y:
        Z:
        yaw:
        pitch:
    - world_the_end:
        X:
        Y:
        Z:
        yaw:
        pitch:
    it look like like this
     
  2. Offline

    MiniDigger

    if u do this it will looks like yours:
    Code:
    config.set(worldlist.world.x, 1);
    config.set(worldlist.world.y, 1);
    config.set(worldlist.world.z, 1);
    config.set(worldlist.world.yaw, 1);
    config.set(worldlist.world.pitch, 1);
     
    config.set(worldlist.world_nether.x, 1);
    config.set(worldlist.world_nether.y, 1);
    config.set(worldlist.world_nether.z, 1);
    config.set(worldlist.world_nether.yaw, 1);
    config.set(worldlist.world_nether.pitch, 1);
     
  3. Offline

    brittanybitsh

    nope it stayed the same, and yes i did saveConfig();
     
  4. Offline

    stickeric

    Code:java
    1.  
    2. getConfig().set("worldlist.world.x", "1");
    3. getConfig().set("worldlist.world.y", "2");
    4. getConfig().set("worldlist.world.z", "3");
    5. getConfig().set("worldlist.world.yaw", "4");
    6. getConfig().set("worldlist.world.pitch", "5");
    7.  
    8. getConfig().set("worldlist.world_nether.x", "1");
    9. getConfig().set("worldlist.world_nether.y", "2");
    10. getConfig().set("worldlist.world_nether.z", "3");
    11. getConfig().set("worldlist.world_nether.y", "4");
    12. getConfig().set("worldlist.world_nether.pitch", "5");
    13.  


    Tell me if this works? @brittanybitsh
     
  5. Offline

    Cronos79

    putting a . (period) in the path string tells the plugin that its a nested path.. If I said that right.. Like the others are typing out for you

    "worldlist.world_nether.pitch" worldlist(dot)world(dot etc
     
Thread Status:
Not open for further replies.

Share This Page