From bbfbe1e72c0d61734ea7cb9dbd08107839522eca Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 5 Feb 2013 23:58:15 -0500 Subject: [PATCH] Remove max level check - Bukkit now does the checking for us. --- .../com/gmail/nossr50/skills/utilities/SkillTools.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java index eeeb87cb8..85e612bba 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java @@ -28,6 +28,7 @@ public class SkillTools { public static void handleFoodSkills(Player player, SkillType skill, FoodLevelChangeEvent event, int baseLevel, int maxLevel, int rankChange) { int skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(skill); + int currentFoodLevel = player.getFoodLevel(); int newFoodLevel = event.getFoodLevel(); int foodChange = newFoodLevel - currentFoodLevel; @@ -38,14 +39,7 @@ public class SkillTools { } } - /* Make sure we don't go over the max value */ - newFoodLevel = currentFoodLevel + foodChange; - if (newFoodLevel > 20) { - event.setFoodLevel(20); - } - else { - event.setFoodLevel(newFoodLevel); - } + event.setFoodLevel(currentFoodLevel + foodChange); } /**