mcMMO will no longer use the DamageModifier API (potentially fix immortal player bug)

This commit is contained in:
nossr50
2022-03-17 19:58:42 -07:00
parent 8066f7f7f2
commit 5ab55c1653
42 changed files with 188 additions and 432 deletions

View File

@@ -15,12 +15,9 @@ import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.skills.*;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
public class AxesManager extends SkillManager {
public AxesManager(McMMOPlayer mcMMOPlayer) {
super(mcMMOPlayer, PrimarySkillType.AXES);
@@ -93,8 +90,7 @@ public class AxesManager extends SkillManager {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CriticalHit");
}
if (target instanceof Player) {
Player defender = (Player) target;
if (target instanceof Player defender) {
if (NotificationManager.doesPlayerUseNotifications(defender)) {
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CritStruck");
@@ -150,8 +146,7 @@ public class AxesManager extends SkillManager {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Proc");
}
if (target instanceof Player) {
Player defender = (Player) target;
if (target instanceof Player defender) {
if (NotificationManager.doesPlayerUseNotifications(defender)) {
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Struck");
@@ -163,11 +158,10 @@ public class AxesManager extends SkillManager {
/**
* Handle the effects of the Skull Splitter ability
*
* @param target The {@link LivingEntity} being affected by the ability
* @param target The {@link LivingEntity} being affected by the ability
* @param damage The amount of damage initially dealt by the event
*/
public void skullSplitterCheck(@NotNull LivingEntity target, double damage, Map<DamageModifier, Double> modifiers) {
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Axes.skullSplitterModifier, modifiers, skill);
public void skullSplitterCheck(@NotNull LivingEntity target, double damage) {
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Axes.skullSplitterModifier, skill);
}
}