mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Only apply permissions when skill is enabled
This commit is contained in:
parent
0261d16140
commit
8552192894
@ -506,14 +506,15 @@ public class McMMOPlayer {
|
||||
Set<SkillType> parentSkills = FamilyTree.getParents(skillType);
|
||||
|
||||
for (SkillType parentSkill : parentSkills) {
|
||||
if (Permissions.skillEnabled(player, parentSkill)) {
|
||||
applyXpGain(parentSkill, xp / parentSkills.size());
|
||||
}
|
||||
applyXpGain(parentSkill, xp / parentSkills.size());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Permissions.skillEnabled(player, skillType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayerXpGainEvent event = new McMMOPlayerXpGainEvent(player, skillType, xp);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user