Fix bug where smelting allowed for XP gain in Mining/Repair even if

permissions were not present.
This commit is contained in:
GJ 2013-01-26 00:25:14 -05:00
parent 4692a461eb
commit 56e16acce4

View File

@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class SmeltResourceEventHandler { public class SmeltResourceEventHandler {
private SmeltingManager manager; private SmeltingManager manager;
@ -66,8 +67,13 @@ public class SmeltResourceEventHandler {
break; break;
} }
Skills.xpProcessing(player, profile, SkillType.MINING, xp / 2); if (Permissions.mining(player)) {
Skills.xpProcessing(player, profile, SkillType.REPAIR, xp / 2); Skills.xpProcessing(player, profile, SkillType.MINING, xp / 2);
}
if (Permissions.repair(player)) {
Skills.xpProcessing(player, profile, SkillType.REPAIR, xp / 2);
}
} }
protected void handleBonusSmelts() { protected void handleBonusSmelts() {