Solved Config defaults string list setting only one value

Discussion in 'Plugin Development' started by Kermit_23, Jul 25, 2017.

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

    Kermit_23

    The title explains the problem pretty much (more descriptive problem below)...
    I tried
    Code:
    List<String> list = new ArrayList<String>();
            list.add("bl.spamcop.net");
            list.add("b.barracudacentral.org");
            list.add("dnsbl.dronebl.plorg");
            list.add("db.wpbl.info");
    then
    Code:
                for (String s : list) {
                    getConfig().addDefault("settings.dnsbl.servers", s);
                }
    but i get only one value but as a string and not a list with 4 strings!
    Code:
    dnsbl:
        servers: db.wpbl.info
    Any way on how to fix this? i cant figure out on how to set a string-list as defaults in config
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Kermit_23 Just set the list as default instead of the values in the list.
     
    Kermit_23 likes this.
  3. Offline

    Kermit_23

    works! i'm so stupid because i haven't tried this lol!
     
    timtower likes this.
  4. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page