Solved Yml help.

Discussion in 'Plugin Development' started by A4Papers, May 25, 2014.

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

    A4Papers

    How would i get the last 5 entries to a .yml list

    I'm using this to add the info into the list.

    Code:java
    1. List<String> list = this.customConfig.getStringList("log");
    2. list.add(log);
    3. this.customConfig.set("log", list);
    4.  
     
  2. Offline

    TopTobster5

    A4Papers Load it all into a list, check the length and then take the last 5 entries using square brackets.
     
    A4Papers likes this.
  3. Offline

    A4Papers

    How would i do that?
     
  4. Offline

    TopTobster5

    A4Papers
    Code:java
    1. int i = list.size();
    2. String 1st = list.get(i-5)//first one
    3. String 2nd = list.get(i-4)//second one
    4. //etc...
    5.  
     
    A4Papers likes this.
  5. Offline

    A4Papers

    Thanks :)
     
Thread Status:
Not open for further replies.

Share This Page