Solved Multi config file

Discussion in 'Plugin Development' started by rawiuwt, Aug 15, 2013.

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

    rawiuwt

    I have to make 2 config
    1.config.yml
    2.message.yml
    in config.yml is use getConfig()
    but i doesn't know im message.yml what syntax to use.
     
  2. Offline

    tommycake50

    Thats easy.
    Code:java
    1.  
    2. private void loadConfigFile(String name){
    3. //getDataFolder is the folder your plugin stores the config in like where saveDefaultConfig stores it and the name is self explanatory
    4. File f = new File(getDataFolder(), name);
    5. //so is this
    6. if(!f.exists())f.createNewFile();
    7. //have a variable to hold this
    8. somevariable = Yaml.loadConfiguration(f);
    9. }
    10.  
     
  3. Offline

    rawiuwt

    Thanks

    tommycake50 How i use it i don't understand.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  4. Offline

    rawiuwt

  5. rawiuwt No problem! Happy coding!
     
Thread Status:
Not open for further replies.

Share This Page