Solved Config resets on reload.

Discussion in 'Plugin Development' started by Zombie_Striker, Oct 12, 2017.

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

    Zombie_Striker

    This is a really weird one. For one of the plugins I am working on, every time the server reloads, the config clears itself.
    1. The only references to the config are to save a string.
    2. Happens for both the config.yml and all custom configs for this one plugin.
    3. Configs for other plugins still work.
    4. Happens even if I renaming the plugin/data folder.
    [Edit] After more testing, it seems it works as long as it is on the same session. Reloading with not load the values from the config, which is why it clears itself on saving.

    [Edit2] It seems it works if there is only default values such as Strings or ints in the config, but does not work for custom classes that I registered.

    [Edit3] Is there a limit to the amount of sub-classes that can be stored within a single object in the config?

    [Edit4] Seems that all custom classes in my plugin are deleted on reload. Does anyone know why this is happening?
     
    Last edited: Oct 12, 2017
  2. Offline

    Horsey

    Might we have some code and perhaps a snippet of what your config should look like?

    This does seem quite queer.
     
  3. Offline

    MightyOne

    Do you have any... way to save a while ovject if custom class as a string? And a constructer to create one from String? And you write saveConfig() behind every edit?
     
  4. Offline

    Zombie_Striker

    Solved.

    I assumed that the maps could inherit the constructor from super classes. This is not the case. Turns out that you need a constructor that requires a Map in every class that can be saved to the config, even if the sub-class stores the same values as the super class.
     
  5. Offline

    MightyOne

    So at some point i was right?
     
Thread Status:
Not open for further replies.

Share This Page