From f5b3cf43502db7f69a84dac1673195b659f08e78 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 15 Jan 2019 03:39:06 -0800 Subject: [PATCH] The remaining skills now hide stats until unlocked --- .../nossr50/commands/skills/SalvageCommand.java | 4 ++-- .../nossr50/commands/skills/SmeltingCommand.java | 6 +++--- .../nossr50/commands/skills/SwordsCommand.java | 7 ++++--- .../nossr50/commands/skills/TamingCommand.java | 16 ++++++++-------- .../nossr50/commands/skills/UnarmedCommand.java | 11 ++++++----- .../commands/skills/WoodcuttingCommand.java | 12 ++++++------ 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java index 141f11e7b..04a739851 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java @@ -30,8 +30,8 @@ public class SalvageCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canAdvancedSalvage = Permissions.isSubSkillEnabled(player, SubSkillType.SALVAGE_ADVANCED_SALVAGE); - canArcaneSalvage = Permissions.isSubSkillEnabled(player, SubSkillType.SALVAGE_ARCANE_SALVAGE); + canAdvancedSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ADVANCED_SALVAGE); + canArcaneSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index 67200ea81..20e937752 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -55,9 +55,9 @@ public class SmeltingCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canFuelEfficiency = Permissions.isSubSkillEnabled(player, SubSkillType.SMELTING_FUEL_EFFICIENCY); - canSecondSmelt = Permissions.isSubSkillEnabled(player, SubSkillType.SMELTING_SECOND_SMELT); - canFluxMine = Permissions.isSubSkillEnabled(player, SubSkillType.SMELTING_FLUX_MINING); + canFuelEfficiency = canUseSubskill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY); + canSecondSmelt = canUseSubskill(player, SubSkillType.SMELTING_SECOND_SMELT); + canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING); canVanillaXPBoost = Permissions.vanillaXpBoost(player, skill); } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index fcedc6c23..cb8b791e1 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -7,6 +7,7 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.swords.Swords; 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; @@ -58,9 +59,9 @@ public class SwordsCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canBleed = Permissions.isSubSkillEnabled(player, SubSkillType.SWORDS_BLEED); - canCounter = Permissions.isSubSkillEnabled(player, SubSkillType.SWORDS_COUNTER_ATTACK); - canSerratedStrike = Permissions.serratedStrikes(player); + canBleed = canUseSubskill(player, SubSkillType.SWORDS_BLEED); + canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK); + canSerratedStrike = RankUtils.hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index b87516508..d83e893b8 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -44,15 +44,15 @@ public class TamingCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canBeastLore = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_BEAST_LORE); + canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE); canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT); - canEnvironmentallyAware = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); - canFastFood = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_FAST_FOOD_SERVICE); - canGore = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_GORE); - canSharpenedClaws = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_SHARPENED_CLAWS); - canShockProof = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_SHOCK_PROOF); - canThickFur = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_THICK_FUR); - canHolyHound = Permissions.isSubSkillEnabled(player, SubSkillType.TAMING_HOLY_HOUND); + canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); + canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE); + canGore = canUseSubskill(player, SubSkillType.TAMING_GORE); + canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS); + canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF); + canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR); + canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 129d5ea02..72f67f7d0 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -6,6 +6,7 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.unarmed.Unarmed; 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; @@ -71,11 +72,11 @@ public class UnarmedCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canBerserk = Permissions.berserk(player); - canIronArm = Permissions.isSubSkillEnabled(player, SubSkillType.UNARMED_IRON_ARM_STYLE); - canDeflect = Permissions.isSubSkillEnabled(player, SubSkillType.UNARMED_ARROW_DEFLECT); - canDisarm = Permissions.isSubSkillEnabled(player, SubSkillType.UNARMED_DISARM); - canIronGrip = Permissions.isSubSkillEnabled(player, SubSkillType.UNARMED_IRON_GRIP); + canBerserk = RankUtils.hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(player); + canIronArm = canUseSubskill(player, SubSkillType.UNARMED_IRON_ARM_STYLE); + canDeflect = canUseSubskill(player, SubSkillType.UNARMED_ARROW_DEFLECT); + canDisarm = canUseSubskill(player, SubSkillType.UNARMED_DISARM); + canIronGrip = canUseSubskill(player, SubSkillType.UNARMED_IRON_GRIP); // TODO: Apparently we forgot about block cracker? } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index ae2e44934..f9a841124 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -53,12 +53,12 @@ public class WoodcuttingCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canTreeFell = Permissions.treeFeller(player); - canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1; - canLeafBlow = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_LEAF_BLOWER); - canSplinter = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_SPLINTER); - canBarkSurgeon = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_BARK_SURGEON); - canNaturesBounty = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY); + canTreeFell = RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player); + canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1; + canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER); + canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER); + canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON); + canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY); } @Override