Solved config apostrophes/quotes disappear after restart?!

Discussion in 'Plugin Development' started by goodstuff20, Feb 4, 2015.

Thread Status:
Not open for further replies.
  1. In the config if I add something to an empty configurable and restart/start the server the quotes go away?!??!?

    heres the load and reload method
    Code:
    public static void reloadConfig() {
            CompassGui.instance.reloadConfig();
            FileConfiguration c = CompassGui.instance.getConfig();
    
           (header...)
    
            c.addDefault("compass-name", "&3Teleporter");
            c.addDefault("compass-lore", "");
            c.addDefault("AllBungeeServerNames", "");
            c.addDefault("someTOther", "");
           
            c.options().copyDefaults(true);
            CompassGui.instance.saveConfig();
        }
    
    <Edited by bwfcwalshy: Merged posts, please use the edit button rather than double posting.>
     
    Last edited by a moderator: Feb 4, 2015
  2. Offline

    Lewishjames

    In quotes i'm guessing you are meaning # This is default config etc etc... Well you need to use this,

    Code:
     public void onEnable() {
                    getConfig().options().copyDefaults(true);
                    saveConfig();
     
  3. Lewishjames likes this.
  4. Offline

    Lewishjames

    Yes correct.
     
  5. ah thanks - I just changed it to only list the defaults if the config doesnt exist though and instead have (just) the reloadConfig
     
Thread Status:
Not open for further replies.

Share This Page