Method for Saving FileConfigurations

Discussion in 'Plugin Development' started by Blah1, Feb 25, 2014.

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

    Blah1

    I don't know why this won't work:

    Code:java
    1. public void save(String s) {
    2. FileConfiguration fc = plugin.playerFile(s);
    3. try {
    4. fc.save(plugin.playerData(s));
    5. } catch (IOException e) {
    6. e.printStackTrace();
    7. }
    8. }


    Works when I use it with other stuff in it (fc.set(...) etc.) but not when I use it just on its own.
    Is there a reason why?
     
  2. Offline

    calebbfmv

    I have ALMOST no idea why its this way, but reloading the FileConfiguration again on save, it seems to not register all the changes:
    Just remove this
    Code:
    FileConfiguration fc = plugin.playerFile(s);
     
  3. Offline

    Blah1

  4. Offline

    xTrollxDudex

    Blah1
    You cannot loadConfiguration to get the file's FileConfiguration. You must store it locally.
     
  5. Offline

    calebbfmv

  6. Offline

    Blah1

  7. Offline

    calebbfmv

    Blah1
    Surrounded by trying and catching yes
     
  8. Offline

    xTrollxDudex

    I restated it, adding a suggestion. Comments are not possessive.
     
  9. Offline

    calebbfmv

Thread Status:
Not open for further replies.

Share This Page