From 1617eefa1c3f965e0ffe08badc2caf09f4784a47 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 1 Oct 2024 20:08:54 +0100 Subject: [PATCH] Fix the last compile error --- .../ability/magic/spell/effect/NecromancySpell.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java index d5c799aa..bb294244 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java @@ -23,6 +23,7 @@ import com.minelittlepony.unicopia.util.Weighted; import com.minelittlepony.unicopia.util.shape.Shape; import com.minelittlepony.unicopia.util.shape.Sphere; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.*; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; @@ -36,6 +37,7 @@ import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.RegistryWrapper.WrapperLookup; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.BlockPos; @@ -169,8 +171,8 @@ public class NecromancySpell extends AbstractAreaEffectSpell implements Projecti LivingEntity master = caster.getMaster(); summonedEntities.forEach(ref -> { ref.ifPresent(caster.asWorld(), e -> { - if (master != null) { - master.applyDamageEffects(master, e); + if (caster.asWorld() instanceof ServerWorld sw) { + EnchantmentHelper.onTargetDamaged(sw, e, e.getDamageSources().indirectMagic(e, master)); } e.getWorld().sendEntityStatus(e, EntityStatuses.ADD_DEATH_PARTICLES); e.discard();