diff --git a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index a79ac6b29..a0ffe2bae 100644 --- a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -5,6 +5,7 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import com.gmail.nossr50.skills.utilities.SkillType; +import com.gmail.nossr50.util.Users; /** * Generic event for mcMMO experience events. @@ -16,7 +17,7 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent { protected McMMOPlayerExperienceEvent(Player player, SkillType skill) { super(player); this.skill = skill; - this.skillLevel = skill.getSkillLevel(player); + this.skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(skill); } /** diff --git a/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java index 3690480c5..925cbe98a 100644 --- a/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java @@ -5,6 +5,7 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import com.gmail.nossr50.skills.utilities.SkillType; +import com.gmail.nossr50.util.Users; /** * Generic event for mcMMO skill handling. @@ -16,7 +17,7 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { protected McMMOPlayerSkillEvent(Player player, SkillType skill) { super(player); this.skill = skill; - this.skillLevel = skill.getSkillLevel(player); + this.skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(skill); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/SkillType.java b/src/main/java/com/gmail/nossr50/skills/utilities/SkillType.java index 65ba6c1e2..7e5015126 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/SkillType.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/SkillType.java @@ -4,7 +4,6 @@ import org.bukkit.entity.Player; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.Users; public enum SkillType { ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()), @@ -129,17 +128,6 @@ public enum SkillType { return null; } - /** - * Get the skill level for this skill. - * - * @param player The player to check - * @return the player's skill level - */ - public int getSkillLevel(Player player) { - // TODO: Child skills aren't handled here - return Users.getPlayer(player).getProfile().getSkillLevel(this); - } - // TODO: This is a little "hacky", we probably need to add something to distinguish child skills in the enum, or to use another enum for them public boolean isChildSkill() { switch (this) {