Skip to content

Commit

Permalink
Fix disabled abilities still showing in abilities menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Jul 7, 2024
1 parent 071eecc commit 2b3c52b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void build(MenuBuilder menu) {
Set<Ability> lockedAbilities = new HashSet<>();
// Add abilities that player has not unlocked yet
for (Ability ability : skill.getAbilities()) {
if (user.getAbilityLevel(ability) <= 0) {
if (user.getAbilityLevel(ability) <= 0 && ability.isEnabled()) {
lockedAbilities.add(ability);
}
}
Expand All @@ -74,7 +74,7 @@ public void build(MenuBuilder menu) {
Set<Ability> unlockedAbilities = new HashSet<>();
// Add abilities that player has not unlocked yet
for (Ability ability : skill.getAbilities()) {
if (user.getAbilityLevel(ability) >= 1) {
if (user.getAbilityLevel(ability) >= 1 && ability.isEnabled()) {
unlockedAbilities.add(ability);
}
}
Expand All @@ -97,7 +97,7 @@ public void build(MenuBuilder menu) {
ManaAbility manaAbility = skill.getManaAbility();

Set<ManaAbility> locked = new HashSet<>();
if (manaAbility != null && plugin.getUser(m.player()).getManaAbilityLevel(manaAbility) <= 0) {
if (manaAbility != null && manaAbility.isEnabled() && plugin.getUser(m.player()).getManaAbilityLevel(manaAbility) <= 0) {
locked.add(manaAbility);
}
return locked;
Expand All @@ -115,7 +115,7 @@ public void build(MenuBuilder menu) {
Set<ManaAbility> unlocked = new HashSet<>();
// Add abilities that player has not unlocked yet
ManaAbility manaAbility = skill.getManaAbility();
if (manaAbility != null && user.getManaAbilityLevel(manaAbility) >= 1) {
if (manaAbility != null && manaAbility.isEnabled() && user.getManaAbilityLevel(manaAbility) >= 1) {
unlocked.add(manaAbility);
}
return unlocked;
Expand Down

0 comments on commit 2b3c52b

Please sign in to comment.