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:
parent
dad2ce21e4
commit
a8ac621f51
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user