Fix default abilities list initialization

Previously, the default value for the abilities list was null, leading to potential NullPointerExceptions. This change initializes the default list as an empty list to prevent such errors.
This commit is contained in:
auto committed 2024-10-18 19:50:13 +02:00
1 parent dad2ce21e4
commit a8ac621f51
1 file changed
+1 -1
@@ -53,7 +53,7 @@ public class MobTypes extends AbstractConfig {
}
Set<String> keys = configurationSection.getKeys(false);
keys.forEach(key -> {
List<Ability> abilities = config.getStringList(prefix + key, ".abilities", null).stream()
List<Ability> abilities = config.getStringList(prefix + key, ".abilities", List.of()).stream()
.map(MobTypes.MOB_TYPES::getAbility)
.filter(Optional::isPresent)
.map(Optional::get)