Allow non-existent pet-items nodes.
If someone spins up MobArena with a really old config-file or simply removes the `pet-items` section, the plugin throws an NPE. This commit fixes that by allowing the section to not exist. It might be a good idea to log some helpful information, but let's wait and see if this isn't good enough. Fixes #606, closes #608. Thanks Chew!
This commit is contained in:
@@ -280,6 +280,9 @@ public class ArenaMasterImpl implements ArenaMaster
|
||||
spawnsPets.clear();
|
||||
|
||||
ConfigurationSection items = settings.getConfigurationSection("pet-items");
|
||||
if (items == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (String key : items.getKeys(false)) {
|
||||
EntityType entity;
|
||||
|
||||
Reference in New Issue
Block a user