Custom config

Discussion in 'Plugin Development' started by 4thegame3, Mar 1, 2015.

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

    4thegame3

    Code:
    Reader defConfigStream = new InputStreamReader(plugin.getResource("config.yml"));
         if (defConfigStream != null) {
           YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
           ConfigConfiguration.setDefaults(defConfig);
         }
    try {
      ConfigConfiguration.save(ConfigFile);
      } catch (IOException e) {
      plugin.getLogger().severe("Could not save the config file to the disk!");
      }
    This saves only the header, why?
     
  2. Offline

    Zombie_Striker

    Are you trying to get the Config.yml of a plugin? If so just use .getConfig() and saveConfig().
     
  3. Offline

    4thegame3

    I'm trying to export the config inside the jar
     
  4. Offline

    Zombie_Striker

    Why would you need to do that? Just set the onEnable to saveConfig and if its empty, set the values you want and then save it again. There should be no reason you would need to export the config.
     
  5. Offline

    4thegame3

    did you even understand what i mean?
     
Thread Status:
Not open for further replies.

Share This Page