Solved Wiping a config StringList

Discussion in 'Plugin Development' started by ChazSchmidt, May 22, 2014.

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

    ChazSchmidt

    Code:java
    1. getConfig().set("sChestLoc", null);
    2.  
    3. saveConfig();

    Ok, when I execute this code it does not reset or remove or clear the given path, any ideas?
     
  2. Offline

    Bammerbom

    ChazSchmidt This code will work so I am not sure what is wrong.
     
  3. Offline

    ChazSchmidt

    Bammerbom Exactly what I was thinking... although I half-wondered if 3am coding had gotten the best of me
     
  4. Offline

    SnipsRevival

    Try adding some debug messages to see if that code is even being executed.
     
  5. Offline

    RainoBoy97

    Code:
    getConfig().set("sChestLoc", new ArrayList<>());
     
    ChazSchmidt likes this.
  6. Offline

    ChazSchmidt

    SnipsRevival it's executing because the line right after it is properly adding to that config list but since it isn't clearing it the list essentially doubles

    RainoBoy97 Tried it and no luck
     
  7. Offline

    RainoBoy97

    ChazSchmidt
    Did you remember to save the config?
    Code:
    saveConfig();
    
     
  8. Offline

    ChazSchmidt

    RainoBoy97 Yes I just replaced the null line. It still doesn't clear it
     
  9. Offline

    Onlineids

    Try:
    getConfig().getStringList().clear()
     
    ChazSchmidt likes this.
  10. Offline

    ChazSchmidt

    Onlineids that along with a few more list checks and clears here and there fixed it. Thanks everyone for your help
     
Thread Status:
Not open for further replies.

Share This Page