mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 21:15:28 +02:00
Refactoring code part 1 to prep for adding a bunch of unit tests
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.gmail.nossr50.runnables.skills;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
@@ -41,7 +39,7 @@ public class AbilityDisableTask extends BukkitRunnable {
|
||||
// Fallthrough
|
||||
|
||||
case BERSERK:
|
||||
if (Config.getInstance().getRefreshChunksEnabled()) {
|
||||
if (mcMMO.p.getGeneralConfig().getRefreshChunksEnabled()) {
|
||||
resendChunkRadiusAt(player);
|
||||
}
|
||||
// Fallthrough
|
||||
@@ -62,7 +60,7 @@ public class AbilityDisableTask extends BukkitRunnable {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.ABILITY_OFF, ability.getAbilityOff());
|
||||
}
|
||||
|
||||
if (AdvancedConfig.getInstance().sendAbilityNotificationToOtherPlayers()) {
|
||||
if (mcMMO.p.getAdvancedConfig().sendAbilityNotificationToOtherPlayers()) {
|
||||
SkillUtils.sendSkillMessage(player, NotificationType.SUPER_ABILITY_ALERT_OTHERS, ability.getAbilityPlayerOff());
|
||||
}
|
||||
new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLater(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
|
||||
|
@@ -57,7 +57,7 @@
|
||||
// double damage;
|
||||
//
|
||||
// if (target instanceof Player) {
|
||||
// damage = AdvancedConfig.getInstance().getRuptureDamagePlayer();
|
||||
// damage = mcMMO.p.getAdvancedConfig().getRuptureDamagePlayer();
|
||||
//
|
||||
// //Above Bleed Rank 3 deals 50% more damage
|
||||
// if (containerEntry.getValue().toolTier >= 4 && containerEntry.getValue().bleedRank >= 3)
|
||||
@@ -78,7 +78,7 @@
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// damage = AdvancedConfig.getInstance().getRuptureDamageMobs();
|
||||
// damage = mcMMO.p.getAdvancedConfig().getRuptureDamageMobs();
|
||||
//
|
||||
//// debugMessage+="BaseDMG=["+damage+"], ";
|
||||
//
|
||||
|
@@ -1,9 +1,7 @@
|
||||
package com.gmail.nossr50.runnables.skills;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.MobHealthbarUtils;
|
||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||
import com.google.common.base.Objects;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -28,7 +26,7 @@ public class RuptureTask extends BukkitRunnable {
|
||||
public RuptureTask(@NotNull McMMOPlayer ruptureSource, @NotNull LivingEntity targetEntity, double pureTickDamage, double explosionDamage) {
|
||||
this.ruptureSource = ruptureSource;
|
||||
this.targetEntity = targetEntity;
|
||||
this.expireTick = AdvancedConfig.getInstance().getRuptureDurationSeconds(targetEntity instanceof Player) * 20;
|
||||
this.expireTick = mcMMO.p.getAdvancedConfig().getRuptureDurationSeconds(targetEntity instanceof Player) * 20;
|
||||
|
||||
this.ruptureTick = 0;
|
||||
this.damageTickTracker = 0;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package com.gmail.nossr50.runnables.skills;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ToolLowerTask extends BukkitRunnable {
|
||||
|
||||
mcMMOPlayer.setToolPreparationMode(tool, false);
|
||||
|
||||
if (Config.getInstance().getAbilityMessagesEnabled()) {
|
||||
if (mcMMO.p.getGeneralConfig().getAbilityMessagesEnabled()) {
|
||||
NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.TOOL, tool.getLowerTool());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user