SPIGOT-6274: Reloading configuration does not clear previous values

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2021-01-12 09:37:26 +11:00
parent f338bff9e3
commit 885c2247d1
2 changed files with 43 additions and 0 deletions

View File

@@ -68,10 +68,13 @@ public class YamlConfiguration extends FileConfiguration {
if (input != null) {
convertMapsToSections(input, this);
} else {
this.map.clear();
}
}
protected void convertMapsToSections(@NotNull Map<?, ?> input, @NotNull ConfigurationSection section) {
this.map.clear();
for (Map.Entry<?, ?> entry : input.entrySet()) {
String key = entry.getKey().toString();
Object value = entry.getValue();