From b379597afba546e1b0543c5303b68ad6d1ae7f35 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 16 Feb 2022 17:24:11 +0100 Subject: [PATCH] Fixed an error message with non existing skill modifiers --- src/main/java/net/Indyuce/mmocore/skill/ClassSkill.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/skill/ClassSkill.java b/src/main/java/net/Indyuce/mmocore/skill/ClassSkill.java index 6234e544..47934579 100644 --- a/src/main/java/net/Indyuce/mmocore/skill/ClassSkill.java +++ b/src/main/java/net/Indyuce/mmocore/skill/ClassSkill.java @@ -10,10 +10,7 @@ import net.Indyuce.mmocore.api.util.math.formula.LinearValue; import org.apache.commons.lang.Validate; import org.bukkit.configuration.ConfigurationSection; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class ClassSkill implements CooldownObject { private final RegisteredSkill skill; @@ -74,7 +71,7 @@ public class ClassSkill implements CooldownObject { } public double getModifier(String modifier, int level) { - return modifiers.get(modifier).calculate(level); + return Objects.requireNonNull(modifiers.get(modifier), "Could not find modifier '" + modifier + "'").calculate(level); } public List calculateLore(PlayerData data) {