Solved yml save error

Discussion in 'Plugin Development' started by soulofw0lf, Jul 26, 2013.

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

    soulofw0lf

    anyone have any clue why
    Code:java
    1. List<String> channels = new ArrayList<>();
    2. channels.add("Whisper");
    3. channels.add("Local");
    4. channels.add("Shout");
    5. channels.add("World");
    6. channels.add("General");
    7. channels.add("Party");
    8. channels.add("Guild");
    9. channels.add("Region");
    10. channels.add("Trade");
    11. chatConfig.set("Default Channels", channels);
    12. chatConfig.set("No Leave Channels", channels);


    would be saving like

    Code:
    Default Channels: &id001
    - Whisper
    - Local
    - Shout
    - World
    - General
    - Party
    - Guild
    - Region
    - Trade
    No Leave Channels: *id001
    in the yml?
     
  2. Offline

    Seadragon91

    I tested it and get the same, thats the reason:
    Taked it from wikipedia.

    Edit: If you want to have two same lists then use the clone method to get a copy of the arraylist, then you can save two lists with the same content.
     
  3. Offline

    soulofw0lf

    @Seadragon91 you are a life saver, i googled the hell out of it and couldn't find an answer anywhere :)
     
Thread Status:
Not open for further replies.

Share This Page