From 56e16acce40e6584035fbf525ec91b8ee10a7200 Mon Sep 17 00:00:00 2001 From: GJ Date: Sat, 26 Jan 2013 00:25:14 -0500 Subject: [PATCH] Fix bug where smelting allowed for XP gain in Mining/Repair even if permissions were not present. --- .../skills/smelting/SmeltResourceEventHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltResourceEventHandler.java b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltResourceEventHandler.java index 09c709ea0..75363bb3e 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltResourceEventHandler.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltResourceEventHandler.java @@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Permissions; public class SmeltResourceEventHandler { private SmeltingManager manager; @@ -66,8 +67,13 @@ public class SmeltResourceEventHandler { break; } - Skills.xpProcessing(player, profile, SkillType.MINING, xp / 2); - Skills.xpProcessing(player, profile, SkillType.REPAIR, xp / 2); + if (Permissions.mining(player)) { + Skills.xpProcessing(player, profile, SkillType.MINING, xp / 2); + } + + if (Permissions.repair(player)) { + Skills.xpProcessing(player, profile, SkillType.REPAIR, xp / 2); + } } protected void handleBonusSmelts() {