diff --git a/src/redempt/redlib/configmanager/ConfigField.java b/src/redempt/redlib/configmanager/ConfigField.java index cb58c3a..6d1d68b 100644 --- a/src/redempt/redlib/configmanager/ConfigField.java +++ b/src/redempt/redlib/configmanager/ConfigField.java @@ -79,6 +79,10 @@ public void save(Object object, ConfigurationSection config) { try { if (path.endsWith(".*")) { ConfigMap map = (ConfigMap) field.get(object); + String name = path.substring(0, path.length() - 2); + ConfigurationSection section = config.getConfigurationSection(name); + section = section == null ? config.createSection(name) : section; + map.section = section; map.init(manager); map.save(); return; diff --git a/src/redempt/redlib/configmanager/ConfigManager.java b/src/redempt/redlib/configmanager/ConfigManager.java index 57a0102..f06a2e6 100644 --- a/src/redempt/redlib/configmanager/ConfigManager.java +++ b/src/redempt/redlib/configmanager/ConfigManager.java @@ -209,4 +209,11 @@ public ConfigManager save() { return this; } + /** + * @return The configuration this ConfigManager is loading from and saving to + */ + public YamlConfiguration getConfig() { + return config; + } + }