getStringList().add() problems

Discussion in 'Plugin Development' started by Bjornke, Jul 1, 2012.

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


    Having some huge issues with this. I do not get any errors, however the config.yml does not reflect the addition to the list.

    If it helps here is some code from the plugin:

    This throws absolutely NO errors, and yes, I do save the configuration immediately after. However, I see no reflections on the list in the config. I even changed it to this to test what the hell was going on:

    Still, nothing happened. No errors, no nothing. Acted as if nothing had ever been done.

    if it matters, in my loadConfig() method I have this:

    Also, I'm using the Bukkit API 1.2.5-4.1 SNAPSHOT version

    Any ideas??

    The plugin is suppose to add chests to a list that get's loaded in the beginning. They are treasure chests for a role play plugin I'm working on. The admin is suppose to be able to add additional chests, however nothing happens at all. The existing chests that I put into the list manually get parsed and loaded into an ArrayList no problem, and I load the list as a StringList. No idea why I cannot add to the list in-game.
  2. Offline


    List<String> list = getConfig().getStringList("chests");
    getConfig().set("chests", list);
    adventuretc likes this.
  3. Offline


    This is crazy. I've been searching all over the forums and this one-reply thread solved everything
  4. Offline

    Sagacious_Zed Bukkit Docs

    The reason behind this is because getStringList returns a copy of the underlying list.
Thread Status:
Not open for further replies.

Share This Page