Fixing some more classes broken in the static abuse removal edits

This commit is contained in:
nossr50 2019-09-25 14:08:49 -07:00
parent 32d9eaab3d
commit 297ce64a24
4 changed files with 19 additions and 15 deletions

View File

@ -7,8 +7,10 @@ public class PartyTeleportRecord {
private Player requestor; private Player requestor;
private boolean enabled, confirmRequired; private boolean enabled, confirmRequired;
private int timeout, lastUse; private int timeout, lastUse;
private final mcMMO pluginRef;
public PartyTeleportRecord(mcMMO pluginRef) { public PartyTeleportRecord(mcMMO pluginRef) {
this.pluginRef = pluginRef;
requestor = null; requestor = null;
enabled = true; enabled = true;
confirmRequired = pluginRef.getConfigManager().getConfigParty().getPTP().isPtpAcceptRequired(); confirmRequired = pluginRef.getConfigManager().getConfigParty().getPTP().isPtpAcceptRequired();

View File

@ -25,7 +25,7 @@ public class Roll extends AcrobaticsSubSkill {
private final mcMMO pluginRef; private final mcMMO pluginRef;
public Roll(mcMMO pluginRef) { public Roll(mcMMO pluginRef) {
super("Roll", EventPriority.HIGHEST, SubSkillType.ACROBATICS_ROLL); super(pluginRef, "Roll", EventPriority.HIGHEST, SubSkillType.ACROBATICS_ROLL);
this.pluginRef = pluginRef; this.pluginRef = pluginRef;
} }

View File

@ -86,7 +86,7 @@ public class MiningManager extends SkillManager {
applyXpGain(miningBehaviour.getBlockXp(blockState), XPGainReason.PVE); applyXpGain(miningBehaviour.getBlockXp(blockState), XPGainReason.PVE);
if (mcMMOPlayer.getSuperAbilityMode(skill.getSuperAbility())) { if (mcMMOPlayer.getSuperAbilityMode(pluginRef.getSkillTools().getSuperAbility(skill))) {
pluginRef.getSkillTools().handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), pluginRef.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getToolDurabilityDamage()); pluginRef.getSkillTools().handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), pluginRef.getConfigManager().getConfigSuperAbilities().getSuperAbilityLimits().getToolDurabilityDamage());
} }
@ -100,7 +100,7 @@ public class MiningManager extends SkillManager {
//TODO: Make this readable //TODO: Make this readable
if (pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS)) { if (pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS)) {
pluginRef.getBlockTools().markDropsAsBonus(blockState, mcMMOPlayer.getSuperAbilityMode(skill.getSuperAbility())); pluginRef.getBlockTools().markDropsAsBonus(blockState, mcMMOPlayer.getSuperAbilityMode(pluginRef.getSkillTools().getSuperAbility(skill)));
} }
} }
@ -128,7 +128,9 @@ public class MiningManager extends SkillManager {
mcMMOPlayer.setAbilityDATS(SuperAbilityType.BLAST_MINING, System.currentTimeMillis()); mcMMOPlayer.setAbilityDATS(SuperAbilityType.BLAST_MINING, System.currentTimeMillis());
mcMMOPlayer.setAbilityInformed(SuperAbilityType.BLAST_MINING, false); mcMMOPlayer.setAbilityInformed(SuperAbilityType.BLAST_MINING, false);
new AbilityCooldownTask(pluginRef, mcMMOPlayer, SuperAbilityType.BLAST_MINING).runTaskLater(pluginRef, SuperAbilityType.BLAST_MINING.getCooldown() * pluginRef.getMiscTools().TICK_CONVERSION_FACTOR); new AbilityCooldownTask(pluginRef, mcMMOPlayer, SuperAbilityType.BLAST_MINING)
.runTaskLater(pluginRef, pluginRef.getSkillTools().getSuperAbilityCooldown(SuperAbilityType.BLAST_MINING)
* pluginRef.getMiscTools().TICK_CONVERSION_FACTOR);
} }
/** /**

View File

@ -403,7 +403,7 @@ public class ScoreboardWrapper {
case SKILL_BOARD: case SKILL_BOARD:
Validate.notNull(targetSkill); Validate.notNull(targetSkill);
if (!targetSkill.isChildSkill()) { if (!pluginRef.getSkillTools().isChildSkill(targetSkill)) {
int currentXP = mcMMOPlayer.getSkillXpLevel(targetSkill); int currentXP = mcMMOPlayer.getSkillXpLevel(targetSkill);
sidebarObjective.getScore(scoreboardStrings.LABEL_CURRENT_XP).setScore(currentXP); sidebarObjective.getScore(scoreboardStrings.LABEL_CURRENT_XP).setScore(currentXP);
@ -416,7 +416,7 @@ public class ScoreboardWrapper {
sidebarObjective.getScore(scoreboardStrings.LABEL_LEVEL).setScore(mcMMOPlayer.getSkillLevel(targetSkill)); sidebarObjective.getScore(scoreboardStrings.LABEL_LEVEL).setScore(mcMMOPlayer.getSkillLevel(targetSkill));
if (targetSkill.getSuperAbility() != null) { if (pluginRef.getSkillTools().getSuperAbility(targetSkill) != null) {
boolean stopUpdating; boolean stopUpdating;
if (targetSkill == PrimarySkillType.MINING) { if (targetSkill == PrimarySkillType.MINING) {
@ -431,7 +431,7 @@ public class ScoreboardWrapper {
stopUpdating = (secondsSB == 0 && secondsBM == 0); stopUpdating = (secondsSB == 0 && secondsBM == 0);
} else { } else {
SuperAbilityType ability = targetSkill.getSuperAbility(); SuperAbilityType ability = pluginRef.getSkillTools().getSuperAbility(targetSkill);
Score cooldown = sidebarObjective.getScore(scoreboardStrings.abilityLabelsSkill.get(ability)); Score cooldown = sidebarObjective.getScore(scoreboardStrings.abilityLabelsSkill.get(ability));
int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0); int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0);
@ -482,17 +482,17 @@ public class ScoreboardWrapper {
// Calculate power level here // Calculate power level here
int powerLevel = 0; int powerLevel = 0;
for (PrimarySkillType skill : pluginRef.getSkillTools().NON_CHILD_SKILLS) { // Don't include child skills, makes the list too long for (PrimarySkillType primarySkillType : pluginRef.getSkillTools().NON_CHILD_SKILLS) { // Don't include child skills, makes the list too long
int level = newProfile.getSkillLevel(skill); int level = newProfile.getSkillLevel(primarySkillType);
powerLevel += level; powerLevel += level;
// TODO: Verify that this is what we want - calculated in power level but not displayed // TODO: Verify that this is what we want - calculated in power level but not displayed
if (!skill.doesPlayerHaveSkillPermission(player)) { if (!pluginRef.getPermissionTools().skillEnabled(player, primarySkillType)) {
continue; continue;
} }
sidebarObjective.getScore(scoreboardStrings.skillLabels.get(skill)).setScore(level); sidebarObjective.getScore(scoreboardStrings.skillLabels.get(primarySkillType)).setScore(level);
} }
sidebarObjective.getScore(scoreboardStrings.LABEL_POWER_LEVEL).setScore(powerLevel); sidebarObjective.getScore(scoreboardStrings.LABEL_POWER_LEVEL).setScore(powerLevel);
@ -515,15 +515,15 @@ public class ScoreboardWrapper {
Integer rank; Integer rank;
Player player = pluginRef.getServer().getPlayerExact(playerName); Player player = pluginRef.getServer().getPlayerExact(playerName);
for (PrimarySkillType skill : pluginRef.getSkillTools().NON_CHILD_SKILLS) { for (PrimarySkillType primarySkillType : pluginRef.getSkillTools().NON_CHILD_SKILLS) {
if (!skill.doesPlayerHaveSkillPermission(player)) { if (!pluginRef.getPermissionTools().skillEnabled(player, primarySkillType)) {
continue; continue;
} }
rank = rankData.get(skill); rank = rankData.get(primarySkillType);
if (rank != null) { if (rank != null) {
sidebarObjective.getScore(scoreboardStrings.skillLabels.get(skill)).setScore(rank); sidebarObjective.getScore(scoreboardStrings.skillLabels.get(primarySkillType)).setScore(rank);
} }
} }