Пример #1
0
  public void reload() {
    config.load();
    for (Setting setting : Setting.values())
      if (root.keyExists(setting.path)) setting.loadFromKey(root);

    save();
  }
Пример #2
0
  public Settings(File folder) {
    config = new YamlStorage(new File(folder, "config.yml"), "Citizens Configuration");
    root = config.getKey("");

    config.load();
    for (Setting setting : Setting.values()) {
      if (!root.keyExists(setting.path)) {
        setting.setAtKey(root);
      } else setting.loadFromKey(root);
    }

    save();
  }