Solved Config Not Updating

Discussion in 'Plugin Development' started by BlazingBroGamer, Dec 5, 2014.

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

    BlazingBroGamer

    Code:java
    1. public void setLoc(Location l){
    2. fc.set("X", l.getX());
    3. fc.set("Y", l.getY());
    4. fc.set("Z", l.getZ());
    5. fc.set("World", l.getWorld().getName());
    6. saveConfig();
    7. reloadConfig();
    8. }


    I am using the above code (I have loaded the config, and saved it as well on enable), and I can't seem to figure out why this doesn't load up with the same thing in the config file. I made it print, and reload, many times, but this doesn't seem to work. The config doesn't update, and when I reload, it just gets reset
     
  2. Offline

    mine-care

    Hm, can we see the rest of the class (what is fc?)
     
  3. Offline

    Skionz

  4. Offline

    BlizzardFyre

    We need to know what fc is to help you

    EDIT: I am assuming it means file configuration, so you loaded the config to a variable. What you need to do is do getConfig().set() instead of loading to a variable and using fc.set();
     
  5. Offline

    FabeGabeMC

  6. Offline

    BlazingBroGamer

    FabeGabeMC BlizzardFyre
    Sorry for the late reply, and yes it is a file configuration. I have used this way before, and it has worked so I don't believe thats the error.

    Skionz
    WOW. How did you get that in one go. It was actually that. I can't believe :confused:
     
    Skionz likes this.
Thread Status:
Not open for further replies.

Share This Page