YamlConfiguration getting everything in path

Discussion in 'Plugin Development' started by TwoPointDuck, Jan 21, 2014.

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

    TwoPointDuck

    I need a List<String> of the following things marked in blue

    Ignore the ____ I just needed it so I can mark stuff in blue

    Locations:
    __default_arenas:
    ____//Something in here
    __arenas:
    ____arena_amount: 2
    ____ArenaName 1:
    ______i = 1
    ______j = 2
    ____ArenaName 2:
    ______i = 4
    ______j = 9

    Here it is again in code form:

    Code:
    Locations:
      default_arenas:
        //Something in here
      arenas:
        arena_amount: 2
        Arena Name 1:
          i = 1
          j = 2
        ArenaName 2:
          i = 5
          j = 3
    If arena_amount has to be in the List<String> thats fine, ill just pick it out after.

    Thanks in advance for your quick answer :p
     
  2. Offline

    Warreo

    Code:java
    1. List<String> messages = this.getConfig().getStringList("Locations.arenas.Arena Name 1");
     
  3. Offline

    TwoPointDuck

    Sorry, you misunderstand. I want a list of the keys basically.

    So that my List<String> contains: "Arena Name 1" and "ArenaName 2".

    So really I want a list of the paths that are in Locations.arenas
     
  4. Offline

    xTrollxDudex

    TwoPointDuck
    Aren't you going to use ConfigurationSection#getKeys(boolean)?
     
  5. Offline

    TwoPointDuck

Thread Status:
Not open for further replies.

Share This Page