From a90e4e9c8d6b3679488d9e4710510f5b1491c9b5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 10 Apr 2012 08:48:59 -0700 Subject: [PATCH] Fixed bugs with Herbalism and permissions --- Changelog.txt | 1 + .../com/gmail/nossr50/listeners/mcBlockListener.java | 2 +- src/main/java/com/gmail/nossr50/skills/Herbalism.java | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 46da30b3d..db865aeb2 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,6 +10,7 @@ Key: Version 1.3.06-dev + Added permissions check to skill functions + Added API functions for obtaining offline profiles & profiles via player names + = Fixed bug where Herbalism required double drops permission to give XP = Fixed bug where {0} would be displayed in front of your power level in mcstats = Fixed mmoupdate not being useable from console = Fixed bug with repairing wooden tools diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index 9319b67b1..663c2e9a4 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -155,7 +155,7 @@ public class mcBlockListener implements Listener { Herbalism.herbalismProcCheck(block, player, event, plugin); } - if (mcPermissions.getInstance().herbalismDoubleDrops(player) && Herbalism.canBeGreenTerra(mat)) { + if (mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(mat)) { Herbalism.herbalismProcCheck(block, player, event, plugin); } diff --git a/src/main/java/com/gmail/nossr50/skills/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/Herbalism.java index 09d9d9401..092a94757 100644 --- a/src/main/java/com/gmail/nossr50/skills/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/Herbalism.java @@ -227,8 +227,7 @@ public class Herbalism { if (mat == null) { return; - } - else { + } else if (mcPermissions.getInstance().herbalismDoubleDrops(player)) { ItemStack is = new ItemStack(mat); if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { @@ -250,10 +249,10 @@ public class Herbalism { m.mcDropItem(loc, is); } } - - PP.addXP(SkillType.HERBALISM, xp); - Skills.XpCheckSkill(SkillType.HERBALISM, player); } + + PP.addXP(SkillType.HERBALISM, xp); + Skills.XpCheckSkill(SkillType.HERBALISM, player); } /**