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
+1
View File
@@ -13,6 +13,7 @@ These changes will (most likely) be included in the next version.
## [Unreleased]
- A new `ready` state is now available for arena sign templates. Signs are in this state when all players in the lobby have readied up, but the arena has not yet started due to a start delay timer. Check the wiki for details.
- Arena signs now support dynamic list entry variables for 4 different player lists. As an example, `<notready-1>` results in the name of a player in the lobby who hasn't readied up yet. This is useful for visualizing who is holding up the lobby. Check the wiki for details.
- Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered.
## [0.104.2] - 2020-01-03
- The region overlap check now works across both arena and lobby regions, i.e. all four combinations of intersections between two regions (arena-arena, arena-lobby, lobby-arena, and lobby-lobby) are evaluated.
@@ -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;