Check that config sections exist before trying to copy them.

This commit is contained in:
tastybento 2020-04-20 13:46:58 -07:00
parent 8788110a92
commit 0a4b0af931

View File

@ -184,6 +184,7 @@ public class Level extends Addon {
}
private void copyConfigSection(YamlConfiguration blockConfig, String sectionName) {
if (!getConfig().isConfigurationSection(sectionName)) return;
ConfigurationSection section = getConfig().getConfigurationSection(sectionName);
for (String k:section.getKeys(true)) {
blockConfig.set(sectionName + "." + k, section.get(k));