public void reload() { config.load(); for (Setting setting : Setting.values()) if (root.keyExists(setting.path)) setting.loadFromKey(root); save(); }
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(); }