Config files

Discussion in 'Plugin Development' started by Emirin, May 17, 2011.

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

    Emirin

    MineAdmin is looking to allow users to be able to easily set up your configuration files. However what I'm running into is that everyone uses a different type of config, most popular being .yml and .properties but not excluding .txt, .config, and .xml files. Not to mention those of you who bury your configs in sub folder infrastructures. Is there a convention we can meet so that we could reach a happy medium and make things easy on our users?
     
  2. Offline

    axefan

    I'm not sure what version added this, but take a look at the JavaPlugin.Configuration object.

    I think this is what they want us to use going forward. It saves to the config.yml file in your plugin's folder and all formatting is handled automatically! So far, I've had no problems using this.

    Example:
    Code:
    Configuration config = this.getConfiguration();
    config.setProperty("enabled", true);
    config.setProperty("template.count", 45);
    ...
    Boolean enabled = config.getBoolean("enabled");
    int templateCount = config.getInt("template.count");
     
  3. Offline

    Emirin

    Yea they did add that which a lot of people do use, but there are just as many that by passed it and used either the default java properties object or there own means to the end.
     
Thread Status:
Not open for further replies.

Share This Page