Add "subpoint" to config.yml

Discussion in 'Plugin Development' started by FameForAim, Dec 11, 2014.

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

    FameForAim

    Hi i need to know how to add a value for a path.
    So that for example
    when a1 = 5 a2=7 a3= 14
    at the config.yml stands:
    a:
    5
    7
    14

    so that i can use getconfig().getIntegerList().consists(" A random Number") for example for 5 it will be true for 6 not.

    So whats this command i search?
    Can someone help me?
     
  2. Offline

    SuperOriginal

    Create a list of the integers, then use Configuraton#set(path, object) to set your list.
    Then save the config.
     
  3. Offline

    FameForAim

    But from time to time I want too add more values as subpoints how is this possible?
     
  4. Offline

    SuperOriginal

    Get the list, add and remove values as you wish, set it as the new list.
     
  5. Offline

    FameForAim

    Hmm okey thanks. But how i create a int list and add values? :)
    i hadn't done sth. with lists before
    @SuperOriginal
    Is this right?
    Code:
    ArrayList<Integer> X = new ArrayList<Integer> ();
                X.add(placed.getX());
     
  6. Offline

    SuperOriginal

    I would recommend keeping variable names lowercase to avoid confusion, but yes. That's correct.
     
Thread Status:
Not open for further replies.

Share This Page