Getting/setting YAML flow list with Bukkit configuration?

Discussion in 'Plugin Development' started by r3Fuze, May 9, 2012.

Thread Status:
Not open for further replies.
  1. How would I go about setting/getting a list that looks like this:
    Code:
    MyFlowList:
    - [Test1, Test2]
    - [Bla, Bla, 1]
    I belive it's called a flow list.
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    Thats actually a list of lists.... Where the inner list is in the flow style rather than the block style
     
  3. I tried adding 2 lists to a list and then adding the main list to the config like this:
    Code:
    List list1 = new ArrayList();
                List list2 = new ArrayList();
                list1.add(2);
                list1.add(2);
                list2.add(4);
                list2.add(5);
                List list = new ArrayList();
                list.add(list1);
                list.add(list2);
                config.set("re.test.list", list);
    But it showed up as this in the config:
    Code:
    re:
      test:
        list:
        - - 2
          - 2
        - - 4
          - 5
    
    Could you explain a little more in depth how to do it?
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    AFAIK there is nothing in the bukkit API to force lists to be emitted in the flow style. You will have to use the snakeyaml library which powers bukkit's api.
     
  5. Alright, thanks. I'll give it a go.
     
Thread Status:
Not open for further replies.

Share This Page