From 61d87eff10ae960039e58c4b39d84b3cc7358994 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 15 Jan 2019 02:59:00 -0800 Subject: [PATCH] Axe skill stats are hidden unless unlocked --- .../com/gmail/nossr50/commands/skills/AxesCommand.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index 0a6b24f1a..873fcaac6 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -2,10 +2,12 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.datatypes.skills.subskills.interfaces.SubSkill; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.axes.Axes; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -59,10 +61,10 @@ public class AxesCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canSkullSplitter = Permissions.skullSplitter(player); + canSkullSplitter = Permissions.skullSplitter(player) && RankUtils.hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER); canCritical = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_CRITICAL_STRIKES); - canAxeMastery = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_AXE_MASTERY); - canImpact = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_ARMOR_IMPACT); + canAxeMastery = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_AXE_MASTERY) && RankUtils.hasUnlockedSubskill(player, SubSkillType.AXES_AXE_MASTERY); + canImpact = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_ARMOR_IMPACT) && RankUtils.hasUnlockedSubskill(player, SubSkillType.AXES_ARMOR_IMPACT); canGreaterImpact = Permissions.isSubSkillEnabled(player, SubSkillType.AXES_GREATER_IMPACT); }