Reloading the config doesn't actually do anything.

Discussion in 'Plugin Development' started by Superior_Slime, Aug 20, 2014.

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

    Superior_Slime

    Hello, it's me with yet another thread in this forum. Yikes!

    Anyways, my problem goes as follows. I have a command that will reload the config using this code:

    Code:java
    1. plugin.reloadConfig();
    2. p.sendMessage(ChatColor.BLUE + "[BH] Config reloaded!");



    In my onEnable() method, I have this:

    Code:java
    1. this.getConfig().options().copyDefaults(true);
    2. saveDefaultConfig();


    I'm building on CraftBukkit 1.7.9r0.2

    This is so it copies the notes from the config. Can somebody help me please?
     
  2. Offline

    TheMcScavenger

    I suggest storing all the variables defined in the config in a HashMap, allowing you to read them from there, and just disregard the entire configuration file. You can make it static easily, allowing you to access it from any class (if you want). To reload it, simply remove the contents, and get the new contents from the file.
     
  3. Offline

    Superior_Slime

Thread Status:
Not open for further replies.

Share This Page