The remaining skills now hide stats until unlocked

This commit is contained in:
nossr50 2019-01-15 03:39:06 -08:00
parent 008e29117f
commit f5b3cf4350
6 changed files with 29 additions and 27 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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?
}

View File

@ -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