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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user