Fixed storing null targets

This commit is contained in:
Auxilor 2020-11-21 12:03:53 +00:00
parent cbf40663e1
commit e5aacc2ef8

View File

@ -93,8 +93,10 @@ public class EnchantmentConfig extends EnchantmentYamlConfig {
Set<EnchantmentTarget> targets = new HashSet<>();
targetNames.forEach((s -> {
if(EnchantmentTarget.getByName(s) == null)
if(EnchantmentTarget.getByName(s) == null) {
Logger.error(s + " is an invalid target!");
return;
}
targets.add(EnchantmentTarget.getByName(s));
}));