annotate messaging classes + update more things to use mmoPlayer

This commit is contained in:
nossr50
2020-12-09 18:09:04 -08:00
parent a2a41e77ea
commit 8491d0f4e5
13 changed files with 127 additions and 109 deletions

View File

@@ -43,7 +43,7 @@ public class ExcavationCommand extends SkillCommand {
}
@Override
protected 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<>();
ExcavationManager excavationManager = mmoPlayer.getExcavationManager();
@@ -67,7 +67,7 @@ public class ExcavationCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.EXCAVATION);

View File

@@ -107,7 +107,7 @@ public class FishingCommand extends SkillCommand {
}
@Override
protected 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<>();
if (canFishermansDiet) {
@@ -152,7 +152,7 @@ public class FishingCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.FISHING);

View File

@@ -77,7 +77,7 @@ public class MiningCommand extends SkillCommand {
}
@Override
protected 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<>();
if (canBiggerBombs) {
@@ -111,7 +111,7 @@ public class MiningCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.MINING);

View File

@@ -91,7 +91,7 @@ public class RepairCommand extends SkillCommand {
}
@Override
protected 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<>();
if (canArcaneForge) {
@@ -122,7 +122,7 @@ public class RepairCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.REPAIR);

View File

@@ -36,7 +36,7 @@ public class SalvageCommand extends SkillCommand {
}
@Override
protected 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<>();
SalvageManager salvageManager = mmoPlayer.getSalvageManager();
@@ -65,7 +65,7 @@ public class SalvageCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.SALVAGE);

View File

@@ -67,7 +67,7 @@ public abstract class SkillCommand implements TabExecutor {
}
if (args.length == 0) {
Player player = (Player) sender;
Player player = mmoPlayer.getPlayer();
boolean isLucky = Permissions.lucky(player, skill);
boolean hasEndurance = (PerksUtils.handleActivationPerks(player, 0, 0) != 0);
@@ -79,7 +79,7 @@ public abstract class SkillCommand implements TabExecutor {
player.sendMessage("");
}
permissionsCheck(player);
permissionsCheck(mmoPlayer);
dataCalculations(mmoPlayer, skillValue);
sendSkillCommandHeader(player, mmoPlayer, (int) skillValue);
@@ -209,7 +209,7 @@ public abstract class SkillCommand implements TabExecutor {
}
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
public @NotNull List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
if (args.length == 1) {
return ImmutableList.of("?");
}
@@ -220,11 +220,11 @@ public abstract class SkillCommand implements TabExecutor {
return Math.min((int) skillValue, maxLevel) / rankChangeLevel;
}
protected String[] getAbilityDisplayValues(@NotNull SkillActivationType skillActivationType, @NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkill) {
protected @NotNull String[] getAbilityDisplayValues(@NotNull SkillActivationType skillActivationType, @NotNull McMMOPlayer mmoPlayer, @NotNull SubSkillType subSkill) {
return RandomChanceUtil.calculateAbilityDisplayValues(skillActivationType, mmoPlayer.getPlayer(), subSkill);
}
protected String[] calculateLengthDisplayValues(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
protected @NotNull String[] calculateLengthDisplayValues(@NotNull McMMOPlayer mmoPlayer, float skillValue) {
int maxLength = skill.getSuperAbilityType().getMaxLength();
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
@@ -248,12 +248,12 @@ public abstract class SkillCommand implements TabExecutor {
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };
}
protected String getStatMessage(SubSkillType subSkillType, String... vars)
protected @NotNull String getStatMessage(SubSkillType subSkillType, String... vars)
{
return getStatMessage(false, false, subSkillType, vars);
}
protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars)
protected @NotNull String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars)
{
String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template";
String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription() : subSkillType.getLocaleKeyStatExtraDescription();
@@ -277,13 +277,13 @@ public abstract class SkillCommand implements TabExecutor {
protected abstract void dataCalculations(@NotNull McMMOPlayer mmoPlayer, float skillValue);
protected abstract void permissionsCheck(@NotNull Player player);
protected abstract void permissionsCheck(@NotNull McMMOPlayer mmoPlayer);
//protected abstract List<String> effectsDisplay();
protected abstract List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, float skillValue, boolean hasEndurance, boolean isLucky);
protected abstract @NotNull List<String> statsDisplay(@NotNull McMMOPlayer mmoPlayer, float skillValue, boolean hasEndurance, boolean isLucky);
protected abstract List<Component> getTextComponents(@NotNull McMMOPlayer player);
protected abstract @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer player);
/**
* Checks if a player can use a skill

View File

@@ -61,7 +61,7 @@ public class SmeltingCommand extends SkillCommand {
}
@Override
protected 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<>();
/*if (canFluxMine) {
@@ -88,7 +88,7 @@ public class SmeltingCommand extends SkillCommand {
}
@Override
protected List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
protected @NotNull List<Component> getTextComponents(@NotNull McMMOPlayer mmoPlayer) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(mmoPlayer, textComponents, PrimarySkillType.SMELTING);