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:
Chew
2020-03-29 05:32:08 +02:00
committed by Andreas Troelsen
parent 5369b1fbfa
commit c9b36f4993
2 changed files with 4 additions and 0 deletions
@@ -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;