fix config sections

This commit is contained in:
xGinko 2023-09-08 21:17:29 +02:00
parent 50c734eccd
commit b23eb69933

View File

@ -161,14 +161,16 @@ public class Config {
}
public ConfigSection getConfigSection(String path, Map<String, Object> defaultKeyValue) {
config.addDefault(path, null);
config.makeSectionLenient(path);
config.addDefault(path, defaultKeyValue);
defaultKeyValue.forEach((string, object) -> config.addExample(path+"."+string, object));
return config.getConfigSection(path);
}
public ConfigSection getConfigSection(String path, Map<String, Object> defaultKeyValue, String comment) {
config.addDefault(path, null, comment);
config.makeSectionLenient(path);
config.addDefault(path, defaultKeyValue, comment);
defaultKeyValue.forEach((string, object) -> config.addExample(path+"."+string, object));
return config.getConfigSection(path);
}