fix skill commands

This commit is contained in:
nossr50 2020-12-10 16:15:47 -08:00
parent 1c132ddb12
commit 0e22583df4
16 changed files with 101 additions and 95 deletions

View File

@ -76,8 +76,8 @@ public class AlchemyCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canCatalysis = canUseSubskill(player, SubSkillType.ALCHEMY_CATALYSIS); canCatalysis = canUseSubskill(mmoPlayer, SubSkillType.ALCHEMY_CATALYSIS);
canConcoctions = canUseSubskill(player, SubSkillType.ALCHEMY_CONCOCTIONS); canConcoctions = canUseSubskill(mmoPlayer, SubSkillType.ALCHEMY_CONCOCTIONS);
} }
@Override @Override
@ -104,7 +104,7 @@ public class AlchemyCommand extends SkillCommand {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ALCHEMY); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.ALCHEMY);
return textComponents; return textComponents;
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -11,7 +11,6 @@ import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,11 +1,12 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.skills.crossbows.CrossbowManager; import com.gmail.nossr50.skills.crossbows.CrossbowManager;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.md_5.bungee.api.chat.TextComponent; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -29,9 +30,9 @@ public class CrossbowsCommand extends SkillCommand {
protected @NotNull List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, float skillValue, boolean hasEndurance, boolean isLucky) { protected @NotNull List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>(); List<String> messages = new ArrayList<>();
CrossbowManager crossbowManager = mcMMO.getUserManager().getPlayer(player).getCrossbowManager(); CrossbowManager crossbowManager = mmoPlayer.getCrossbowManager();
if(canUseSubskill(player, SubSkillType.CROSSBOWS_SUPER_SHOTGUN)) { if(canUseSubskill(mmoPlayer, SubSkillType.CROSSBOWS_SUPER_SHOTGUN)) {
String additionalArrowCount = String.valueOf(crossbowManager.getSuperShotgunAdditionalArrowCount()); String additionalArrowCount = String.valueOf(crossbowManager.getSuperShotgunAdditionalArrowCount());
messages.add(getStatMessage(SubSkillType.CROSSBOWS_SUPER_SHOTGUN, additionalArrowCount)); messages.add(getStatMessage(SubSkillType.CROSSBOWS_SUPER_SHOTGUN, additionalArrowCount));
} }
@ -40,10 +41,10 @@ public class CrossbowsCommand extends SkillCommand {
} }
@Override @Override
protected List<TextComponent> getTextComponents(Player player) { protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<TextComponent> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.CROSSBOWS); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.CROSSBOWS);
return textComponents; return textComponents;
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@ -30,7 +29,7 @@ public class ExcavationCommand extends SkillCommand {
protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) { protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
// GIGA DRILL BREAKER // GIGA DRILL BREAKER
if (canGigaDrill) { if (canGigaDrill) {
String[] gigaDrillStrings = calculateLengthDisplayValues(player, skillValue); String[] gigaDrillStrings = calculateLengthDisplayValues(mmoPlayer, skillValue);
gigaDrillBreakerLength = gigaDrillStrings[0]; gigaDrillBreakerLength = gigaDrillStrings[0];
gigaDrillBreakerLengthEndurance = gigaDrillStrings[1]; gigaDrillBreakerLengthEndurance = gigaDrillStrings[1];
} }
@ -38,8 +37,8 @@ public class ExcavationCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canGigaDrill = Permissions.gigaDrillBreaker(player) && RankUtils.hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER); canGigaDrill = Permissions.gigaDrillBreaker(mmoPlayer.getPlayer()) && RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
canTreasureHunt = canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY); canTreasureHunt = canUseSubskill(mmoPlayer, SubSkillType.EXCAVATION_ARCHAEOLOGY);
} }
@Override @Override

View File

@ -54,14 +54,14 @@ public class MiningCommand extends SkillCommand {
// DOUBLE DROPS // DOUBLE DROPS
if (canDoubleDrop) { if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS); String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.MINING_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0]; doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
} }
// SUPER BREAKER // SUPER BREAKER
if (canSuperBreaker) { if (canSuperBreaker) {
String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue); String[] superBreakerStrings = calculateLengthDisplayValues(mmoPlayer, skillValue);
superBreakerLength = superBreakerStrings[0]; superBreakerLength = superBreakerStrings[0];
superBreakerLengthEndurance = superBreakerStrings[1]; superBreakerLengthEndurance = superBreakerStrings[1];
} }
@ -69,11 +69,11 @@ public class MiningCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canBiggerBombs = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(player); canBiggerBombs = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(mmoPlayer.getPlayer());
canBlast = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player); canBlast = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(mmoPlayer.getPlayer());
canDemoExpert = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player); canDemoExpert = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(mmoPlayer.getPlayer());
canDoubleDrop = canUseSubskill(mmoPlayer, SubSkillType.MINING_DOUBLE_DROPS); canDoubleDrop = canUseSubskill(mmoPlayer, SubSkillType.MINING_DOUBLE_DROPS);
canSuperBreaker = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player); canSuperBreaker = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(mmoPlayer.getPlayer());
} }
@Override @Override

View File

@ -1,10 +1,12 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -34,6 +36,13 @@ public class MmoInfoCommand implements TabExecutor {
return false; return false;
Player player = (Player) commandSender; Player player = (Player) commandSender;
McMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
if(mmoPlayer == null) {
player.sendMessage(LocaleLoader.getString("Commands.NotLoaded"));
return true;
}
if(Permissions.mmoinfo(player)) if(Permissions.mmoinfo(player))
{ {
if(args == null || args[0] == null) if(args == null || args[0] == null)
@ -48,7 +57,7 @@ public class MmoInfoCommand implements TabExecutor {
return true; return true;
} else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) } else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0]))
{ {
displayInfo(player, args[0]); displayInfo(mmoPlayer, args[0]);
return true; return true;
} }
@ -69,23 +78,23 @@ public class MmoInfoCommand implements TabExecutor {
return ImmutableList.of(); return ImmutableList.of();
} }
private void displayInfo(Player player, String subSkillName) private void displayInfo(@NotNull McMMOPlayer mmoPlayer, String subSkillName)
{ {
//Check to see if the skill exists in the new system //Check to see if the skill exists in the new system
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName); AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName);
if(abstractSubSkill != null) if(abstractSubSkill != null)
{ {
/* New System Skills are programmable */ /* New System Skills are programmable */
abstractSubSkill.printInfo(player); abstractSubSkill.printInfo(mmoPlayer.getPlayer());
//TextComponentFactory.sendPlayerUrlHeader(player); //TextComponentFactory.sendPlayerUrlHeader(player);
} else { } else {
/* /*
* Skill is only in the old system * Skill is only in the old system
*/ */
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header")); mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", subSkillName)); mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", subSkillName));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader")); mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill")); mmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill"));
} }
for(SubSkillType subSkillType : SubSkillType.values()) for(SubSkillType subSkillType : SubSkillType.values())
@ -95,6 +104,6 @@ public class MmoInfoCommand implements TabExecutor {
} }
//Send Player Wiki Link //Send Player Wiki Link
TextComponentFactory.sendPlayerSubSkillWikiLink(player, subSkillName); TextComponentFactory.sendPlayerSubSkillWikiLink(mmoPlayer, subSkillName);
} }
} }

View File

@ -16,7 +16,6 @@ import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@ -69,7 +68,7 @@ public class RepairCommand extends SkillCommand {
// SUPER REPAIR // SUPER REPAIR
if (canSuperRepair) { if (canSuperRepair) {
String[] superRepairStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.REPAIR_SUPER_REPAIR); String[] superRepairStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.REPAIR_SUPER_REPAIR);
superRepairChance = superRepairStrings[0]; superRepairChance = superRepairStrings[0];
superRepairChanceLucky = superRepairStrings[1]; superRepairChanceLucky = superRepairStrings[1];
} }
@ -77,17 +76,17 @@ public class RepairCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canSuperRepair = canUseSubskill(player, SubSkillType.REPAIR_SUPER_REPAIR); canSuperRepair = canUseSubskill(mmoPlayer, SubSkillType.REPAIR_SUPER_REPAIR);
canMasterRepair = canUseSubskill(player, SubSkillType.REPAIR_REPAIR_MASTERY); canMasterRepair = canUseSubskill(mmoPlayer, SubSkillType.REPAIR_REPAIR_MASTERY);
canArcaneForge = canUseSubskill(player, SubSkillType.REPAIR_ARCANE_FORGING); canArcaneForge = canUseSubskill(mmoPlayer, SubSkillType.REPAIR_ARCANE_FORGING);
canRepairDiamond = Permissions.repairMaterialType(player, MaterialType.DIAMOND); canRepairDiamond = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.DIAMOND);
canRepairGold = Permissions.repairMaterialType(player, MaterialType.GOLD); canRepairGold = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.GOLD);
canRepairIron = Permissions.repairMaterialType(player, MaterialType.IRON); canRepairIron = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.IRON);
canRepairStone = Permissions.repairMaterialType(player, MaterialType.STONE); canRepairStone = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.STONE);
canRepairString = Permissions.repairMaterialType(player, MaterialType.STRING); canRepairString = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.STRING);
canRepairLeather = Permissions.repairMaterialType(player, MaterialType.LEATHER); canRepairLeather = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.LEATHER);
canRepairWood = Permissions.repairMaterialType(player, MaterialType.WOOD); canRepairWood = Permissions.repairMaterialType(mmoPlayer.getPlayer(), MaterialType.WOOD);
arcaneBypass = (Permissions.arcaneBypass(player) || Permissions.hasRepairEnchantBypassPerk(player)); arcaneBypass = (Permissions.arcaneBypass(mmoPlayer.getPlayer()) || Permissions.hasRepairEnchantBypassPerk(mmoPlayer.getPlayer()));
} }
@Override @Override
@ -95,7 +94,7 @@ public class RepairCommand extends SkillCommand {
List<String> messages = new ArrayList<>(); List<String> messages = new ArrayList<>();
if (canArcaneForge) { if (canArcaneForge) {
RepairManager repairManager = mcMMO.getUserManager().queryMcMMOPlayer(player).getRepairManager(); RepairManager repairManager = mmoPlayer.getRepairManager();
messages.add(getStatMessage(false, true, messages.add(getStatMessage(false, true,
SubSkillType.REPAIR_ARCANE_FORGING, SubSkillType.REPAIR_ARCANE_FORGING,

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -46,7 +46,7 @@ public class SmeltingCommand extends SkillCommand {
// SECOND SMELT // SECOND SMELT
if (canSecondSmelt) { if (canSecondSmelt) {
String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT); String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.SMELTING_SECOND_SMELT);
str_secondSmeltChance = secondSmeltStrings[0]; str_secondSmeltChance = secondSmeltStrings[0];
str_secondSmeltChanceLucky = secondSmeltStrings[1]; str_secondSmeltChanceLucky = secondSmeltStrings[1];
} }
@ -57,7 +57,7 @@ public class SmeltingCommand extends SkillCommand {
canFuelEfficiency = canUseSubskill(mmoPlayer, SubSkillType.SMELTING_FUEL_EFFICIENCY); canFuelEfficiency = canUseSubskill(mmoPlayer, SubSkillType.SMELTING_FUEL_EFFICIENCY);
canSecondSmelt = canUseSubskill(mmoPlayer, SubSkillType.SMELTING_SECOND_SMELT); canSecondSmelt = canUseSubskill(mmoPlayer, SubSkillType.SMELTING_SECOND_SMELT);
//canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING); //canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
canUnderstandTheArt = Permissions.vanillaXpBoost(mmoPlayer.getPlayer(), skill) && RankUtils.hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART); canUnderstandTheArt = Permissions.vanillaXpBoost(mmoPlayer.getPlayer(), skill) && RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
} }
@Override @Override

View File

@ -11,7 +11,6 @@ import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@ -38,7 +37,7 @@ public class SwordsCommand extends SkillCommand {
protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) { protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
// SWORDS_COUNTER_ATTACK // SWORDS_COUNTER_ATTACK
if (canCounter) { if (canCounter) {
String[] counterStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_COUNTER_ATTACK); String[] counterStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.SWORDS_COUNTER_ATTACK);
counterChance = counterStrings[0]; counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1]; counterChanceLucky = counterStrings[1];
} }
@ -47,14 +46,14 @@ public class SwordsCommand extends SkillCommand {
if (canBleed) { if (canBleed) {
bleedLength = mmoPlayer.getSwordsManager().getRuptureBleedTicks(); bleedLength = mmoPlayer.getSwordsManager().getRuptureBleedTicks();
String[] bleedStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_RUPTURE); String[] bleedStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.SWORDS_RUPTURE);
bleedChance = bleedStrings[0]; bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1]; bleedChanceLucky = bleedStrings[1];
} }
// SERRATED STRIKES // SERRATED STRIKES
if (canSerratedStrike) { if (canSerratedStrike) {
String[] serratedStrikesStrings = calculateLengthDisplayValues(player, skillValue); String[] serratedStrikesStrings = calculateLengthDisplayValues(mmoPlayer, skillValue);
serratedStrikesLength = serratedStrikesStrings[0]; serratedStrikesLength = serratedStrikesStrings[0];
serratedStrikesLengthEndurance = serratedStrikesStrings[1]; serratedStrikesLengthEndurance = serratedStrikesStrings[1];
} }
@ -64,11 +63,11 @@ public class SwordsCommand extends SkillCommand {
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canBleed = canUseSubskill(mmoPlayer, SubSkillType.SWORDS_RUPTURE); canBleed = canUseSubskill(mmoPlayer, SubSkillType.SWORDS_RUPTURE);
canCounter = canUseSubskill(mmoPlayer, SubSkillType.SWORDS_COUNTER_ATTACK); canCounter = canUseSubskill(mmoPlayer, SubSkillType.SWORDS_COUNTER_ATTACK);
canSerratedStrike = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player); canSerratedStrike = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(mmoPlayer.getPlayer());
} }
@Override @Override
protected List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, Player player, float skillValue, boolean hasEndurance, boolean isLucky) { protected @NotNull List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>(); List<String> messages = new ArrayList<>();
int ruptureTicks = mmoPlayer.getSwordsManager().getRuptureBleedTicks(); int ruptureTicks = mmoPlayer.getSwordsManager().getRuptureBleedTicks();
@ -104,7 +103,7 @@ public class SwordsCommand extends SkillCommand {
if(canUseSubskill(mmoPlayer, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) { if(canUseSubskill(mmoPlayer, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000)))); String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(mmoPlayer, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000))));
} }
return messages; return messages;
@ -114,7 +113,7 @@ public class SwordsCommand extends SkillCommand {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SWORDS); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.SWORDS);
return textComponents; return textComponents;
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -9,7 +10,7 @@ import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -35,7 +36,7 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) { protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
if (canGore) { if (canGore) {
String[] goreStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.TAMING_GORE); String[] goreStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.TAMING_GORE);
goreChance = goreStrings[0]; goreChance = goreStrings[0];
goreChanceLucky = goreStrings[1]; goreChanceLucky = goreStrings[1];
} }
@ -43,15 +44,15 @@ public class TamingCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE); canBeastLore = canUseSubskill(mmoPlayer, SubSkillType.TAMING_BEAST_LORE);
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT); canCallWild = Permissions.callOfTheWild(mmoPlayer.getPlayer(), EntityType.HORSE) || Permissions.callOfTheWild(mmoPlayer.getPlayer(), EntityType.WOLF) || Permissions.callOfTheWild(mmoPlayer.getPlayer(), EntityType.OCELOT);
canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); canEnvironmentallyAware = canUseSubskill(mmoPlayer, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE); canFastFood = canUseSubskill(mmoPlayer, SubSkillType.TAMING_FAST_FOOD_SERVICE);
canGore = canUseSubskill(player, SubSkillType.TAMING_GORE); canGore = canUseSubskill(mmoPlayer, SubSkillType.TAMING_GORE);
canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS); canSharpenedClaws = canUseSubskill(mmoPlayer, SubSkillType.TAMING_SHARPENED_CLAWS);
canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF); canShockProof = canUseSubskill(mmoPlayer, SubSkillType.TAMING_SHOCK_PROOF);
canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR); canThickFur = canUseSubskill(mmoPlayer, SubSkillType.TAMING_THICK_FUR);
canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND); canHolyHound = canUseSubskill(mmoPlayer, SubSkillType.TAMING_HOLY_HOUND);
} }
@Override @Override
@ -95,7 +96,7 @@ public class TamingCommand extends SkillCommand {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, this.skill); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, this.skill);
return textComponents; return textComponents;
} }

View File

@ -1,9 +1,10 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.md_5.bungee.api.chat.TextComponent; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -29,10 +30,10 @@ public class TridentsCommand extends SkillCommand {
} }
@Override @Override
protected List<TextComponent> getTextComponents(Player player) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<TextComponent> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.TRIDENTS); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.TRIDENTS);
return textComponents; return textComponents;
} }

View File

@ -10,7 +10,6 @@ import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@ -41,7 +40,7 @@ public class UnarmedCommand extends SkillCommand {
protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) { protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
// UNARMED_ARROW_DEFLECT // UNARMED_ARROW_DEFLECT
if (canDeflect) { if (canDeflect) {
String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT); String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.UNARMED_ARROW_DEFLECT);
deflectChance = deflectStrings[0]; deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1]; deflectChanceLucky = deflectStrings[1];
} }
@ -55,7 +54,7 @@ public class UnarmedCommand extends SkillCommand {
// UNARMED_DISARM // UNARMED_DISARM
if (canDisarm) { if (canDisarm) {
String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM); String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.UNARMED_DISARM);
disarmChance = disarmStrings[0]; disarmChance = disarmStrings[0];
disarmChanceLucky = disarmStrings[1]; disarmChanceLucky = disarmStrings[1];
} }
@ -67,7 +66,7 @@ public class UnarmedCommand extends SkillCommand {
// IRON GRIP // IRON GRIP
if (canIronGrip) { if (canIronGrip) {
String[] ironGripStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_IRON_GRIP); String[] ironGripStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.UNARMED_IRON_GRIP);
ironGripChance = ironGripStrings[0]; ironGripChance = ironGripStrings[0];
ironGripChanceLucky = ironGripStrings[1]; ironGripChanceLucky = ironGripStrings[1];
} }
@ -75,7 +74,7 @@ public class UnarmedCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canBerserk = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(player); canBerserk = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(mmoPlayer.getPlayer());
canIronArm = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_STEEL_ARM_STYLE); canIronArm = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_STEEL_ARM_STYLE);
canDeflect = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_ARROW_DEFLECT); canDeflect = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_ARROW_DEFLECT);
canDisarm = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_DISARM); canDisarm = canUseSubskill(mmoPlayer, SubSkillType.UNARMED_DISARM);
@ -115,9 +114,9 @@ public class UnarmedCommand extends SkillCommand {
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
} }
if(canUseSubskill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) { if(canUseSubskill(mmoPlayer, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, 1000)))); String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(mmoPlayer, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, 1000))));
} }
return messages; return messages;
@ -127,7 +126,7 @@ public class UnarmedCommand extends SkillCommand {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.UNARMED); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.UNARMED);
return textComponents; return textComponents;
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -8,7 +9,7 @@ import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -35,29 +36,29 @@ public class WoodcuttingCommand extends SkillCommand {
protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) { protected void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
// DOUBLE DROPS // DOUBLE DROPS
if (canDoubleDrop) { if (canDoubleDrop) {
setDoubleDropClassicChanceStrings(player); setDoubleDropClassicChanceStrings(mmoPlayer);
} }
// TREE FELLER // TREE FELLER
if (canTreeFell) { if (canTreeFell) {
String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue); String[] treeFellerStrings = calculateLengthDisplayValues(mmoPlayer, skillValue);
treeFellerLength = treeFellerStrings[0]; treeFellerLength = treeFellerStrings[0];
treeFellerLengthEndurance = treeFellerStrings[1]; treeFellerLengthEndurance = treeFellerStrings[1];
} }
} }
private void setDoubleDropClassicChanceStrings(Player player) { private void setDoubleDropClassicChanceStrings(McMMOPlayer mmoPlayer) {
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER); String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, mmoPlayer, SubSkillType.WOODCUTTING_HARVEST_LUMBER);
doubleDropChance = doubleDropStrings[0]; doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1]; doubleDropChanceLucky = doubleDropStrings[1];
} }
@Override @Override
protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) { protected void permissionsCheck(@NotNull McMMOPlayer mmoPlayer) {
canTreeFell = RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player); canTreeFell = RankUtils.hasUnlockedSubskill(mmoPlayer, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(mmoPlayer.getPlayer());
canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1; canDoubleDrop = canUseSubskill(mmoPlayer, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(mmoPlayer, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER); canLeafBlow = canUseSubskill(mmoPlayer, SubSkillType.WOODCUTTING_LEAF_BLOWER);
canKnockOnWood = canTreeFell && canUseSubskill(player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD); canKnockOnWood = canTreeFell && canUseSubskill(mmoPlayer, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD);
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER); /*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON); canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/ canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
@ -75,7 +76,7 @@ public class WoodcuttingCommand extends SkillCommand {
if (canKnockOnWood) { if (canKnockOnWood) {
String lootNote; String lootNote;
if(RankUtils.hasReachedRank(2, player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) { if(RankUtils.hasReachedRank(2, mmoPlayer, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
lootNote = LocaleLoader.getString("Woodcutting.SubSkill.KnockOnWood.Loot.Rank2"); lootNote = LocaleLoader.getString("Woodcutting.SubSkill.KnockOnWood.Loot.Rank2");
} else { } else {
lootNote = LocaleLoader.getString("Woodcutting.SubSkill.KnockOnWood.Loot.Normal"); lootNote = LocaleLoader.getString("Woodcutting.SubSkill.KnockOnWood.Loot.Normal");
@ -100,7 +101,7 @@ public class WoodcuttingCommand extends SkillCommand {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) { protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>(); List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.WOODCUTTING); TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.WOODCUTTING);
return textComponents; return textComponents;
} }

View File

@ -495,7 +495,7 @@ public class TextComponentFactory {
if(subSkillType == SubSkillType.FISHING_MASTER_ANGLER && mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() == null) if(subSkillType == SubSkillType.FISHING_MASTER_ANGLER && mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() == null)
continue; continue;
if(Permissions.isSubSkillEnabled(mmoPlayer, subSkillType)) if(Permissions.isSubSkillEnabled(mmoPlayer.getPlayer(), subSkillType))
{ {
if(!InteractionManager.hasSubSkill(subSkillType)) if(!InteractionManager.hasSubSkill(subSkillType))
textComponents.add(TextComponentFactory.getSubSkillTextComponent(mmoPlayer, subSkillType)); textComponents.add(TextComponentFactory.getSubSkillTextComponent(mmoPlayer, subSkillType));
@ -508,7 +508,7 @@ public class TextComponentFactory {
{ {
if(abstractSubSkill.getPrimarySkill() == parentSkill) if(abstractSubSkill.getPrimarySkill() == parentSkill)
{ {
if(Permissions.isSubSkillEnabled(mmoPlayer, abstractSubSkill)) if(Permissions.isSubSkillEnabled(mmoPlayer.getPlayer(), abstractSubSkill))
textComponents.add(TextComponentFactory.getSubSkillTextComponent(mmoPlayer, abstractSubSkill)); textComponents.add(TextComponentFactory.getSubSkillTextComponent(mmoPlayer, abstractSubSkill));
} }
} }