From 1633617006cc13da9cf0d225ee28dde33edb97c0 Mon Sep 17 00:00:00 2001 From: bm01 Date: Fri, 8 Mar 2013 10:33:20 +0100 Subject: [PATCH] Minor cleanup --- .../com/gmail/nossr50/skills/herbalism/HerbalismManager.java | 4 ++-- .../java/com/gmail/nossr50/skills/mining/MiningManager.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 3b0778efa..28268a3b0 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -77,7 +77,7 @@ public class HerbalismManager extends SkillManager { * @return the modified change in hunger for the event */ public int farmersDiet(int rankChange, int eventFoodLevel) { - return SkillUtils.handleFoodSkills(getPlayer(), SkillType.HERBALISM, eventFoodLevel, Herbalism.farmersDietRankLevel1, Herbalism.farmersDietMaxLevel, rankChange); + return SkillUtils.handleFoodSkills(getPlayer(), skill, eventFoodLevel, Herbalism.farmersDietRankLevel1, Herbalism.farmersDietMaxLevel, rankChange); } /** @@ -342,6 +342,6 @@ public class HerbalismManager extends SkillManager { } private byte getGreenThumbStage() { - return (byte) Math.min(Math.min(getProfile().getSkillLevel(SkillType.HERBALISM), Herbalism.greenThumbStageMaxLevel) / Herbalism.greenThumbStageChangeLevel, 4); + return (byte) Math.min(Math.min(getProfile().getSkillLevel(skill), Herbalism.greenThumbStageMaxLevel) / Herbalism.greenThumbStageChangeLevel, 4); } } diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 862b37b95..0fdd74bb6 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -66,9 +66,11 @@ public class MiningManager extends SkillManager{ return; } + boolean skillTouch = player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH); + for (int i = mcMMOPlayer.getAbilityMode(skill.getAbility()) ? 2 : 1; i != 0; i--) { if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Mining.doubleDropsMaxChance, Mining.doubleDropsMaxLevel)) { - if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) { + if (skillTouch) { Mining.handleSilkTouchDrops(blockState); } else {