fix calling disabled when in error state, fix node creation transversal

This commit is contained in:
jascotty2 2019-09-08 18:37:59 -05:00
parent 2216fa65dc
commit 330ddcfedd
2 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
Metrics.start(this);
} catch (Throwable t) {
getLogger().log(Level.SEVERE, "Unexpected error while loading " + getDescription().getName() + ": Disabling plugin!", t);
emergencyStop();
console.sendMessage(ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return;
}

View File

@ -126,6 +126,8 @@ public class ConfigSection extends MemoryConfiguration {
final String node = (i != 0 ? nodePath.append(root.pathChar) : nodePath).append(pathParts[i]).toString();
if (!(writeTo.get(node) instanceof ConfigSection)) {
writeTo.put(node, travelNode = new ConfigSection(root, travelNode, pathParts[i], useDefault));
} else {
travelNode = (ConfigSection) writeTo.get(node);
}
}
}