YAML Lists

Discussion in 'Plugin Development' started by imjake9, May 17, 2011.

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

    imjake9

    So, I want to be able to create a list in my plugin's configuration file. I basically want to have an array of block IDs. I see the getList() method, but I have no idea how to use it. How can I read a YAML list into an int[] or String[]? Thanks!
     
  2. Offline

    DreadKyller

    PHP:
    Object[] obl =yml.getList("whatever your list is under").toArray();
    len obl.length;
    String[] result={};
    for(
    int i=0;i<len;i++){
        
    result[i]=(String)obl[i];
    }
    if this helps. you can also probably use getKeys("same path as above") instead, but idk.
     
  3. Offline

    imjake9

    Oh, I see, thanks. Looking in the Javadoc, I see there's a getIntList method, which I think I'll use.
    Thanks again, I should've seen that.
     
  4. Offline

    DreadKyller

    you're welcome, my loading script is failing on me so have better luck.
     
Thread Status:
Not open for further replies.

Share This Page