From 6d9db063050d620a10f988f3ac2cdd25b1571c30 Mon Sep 17 00:00:00 2001 From: bm01 Date: Fri, 8 Feb 2013 13:04:26 +0100 Subject: [PATCH] Removed getSkillLevel, it doesn't belong to SkillType --- .../experience/McMMOPlayerExperienceEvent.java | 3 ++- .../nossr50/events/skills/McMMOPlayerSkillEvent.java | 3 ++- .../gmail/nossr50/skills/utilities/SkillType.java | 12 ------------ 3 files changed, 4 insertions(+), 14 deletions(-) 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) {