Solved Config not generating

Discussion in 'Plugin Development' started by TFOXTom, Jun 15, 2018.

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

    TFOXTom

    I have the
    Code:
    getConfig().options().copyDefaults(true)
    , and I save the config using saveConfig(), but it still doesn't generate one. And what makes it even more difficult, is that there are no error messages.
    Does anybody know how to fix this?

    EDIT:
    This is my whole class. I use a different class than my class with onEnable(), justt to clean it up a bit ;)

    Code:
    public class Config {
    
        private static FileConfiguration config;
       
        public static void createConfig(Core core) {
           
            //System.out.println("Test");
           
            core.getConfig().options().copyDefaults(true);
            core.saveConfig();
            config = core.getConfig();
            //System.out.println("Config Loaded!");
           
        }
       
        public static FileConfiguration getConfig() {
           
            return config;
           
        }
       
    }
    
     
    Last edited: Jun 15, 2018
  2. Offline

    MightyOne

    do you have a default config inside your repository? or what are you trying to do? this line of code does not have any mistakes in it. So guess what: we want to see the rest of the class. Otherwise nobody can help you
     
  3. Offline

    TFOXTom

    @MightyOne I have a default config. Just updated the original with the code ;)

    Well, just fixed it. Was as lazy as I normally am, and just thought "Screw this, I'll just make it in the onEnable". And the reason why I didn't do it the first time was because of code management :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 15, 2018
Thread Status:
Not open for further replies.

Share This Page