mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +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);
|
Set<SkillType> parentSkills = FamilyTree.getParents(skillType);
|
||||||
|
|
||||||
for (SkillType parentSkill : parentSkills) {
|
for (SkillType parentSkill : parentSkills) {
|
||||||
if (Permissions.skillEnabled(player, parentSkill)) {
|
applyXpGain(parentSkill, xp / parentSkills.size());
|
||||||
applyXpGain(parentSkill, xp / parentSkills.size());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Permissions.skillEnabled(player, skillType)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
McMMOPlayerXpGainEvent event = new McMMOPlayerXpGainEvent(player, skillType, xp);
|
McMMOPlayerXpGainEvent event = new McMMOPlayerXpGainEvent(player, skillType, xp);
|
||||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user