Fix the last compile error

This commit is contained in:
Sollace 2024-10-01 20:08:54 +01:00
parent 3795e11ff5
commit 1617eefa1c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -23,6 +23,7 @@ import com.minelittlepony.unicopia.util.Weighted;
import com.minelittlepony.unicopia.util.shape.Shape; import com.minelittlepony.unicopia.util.shape.Shape;
import com.minelittlepony.unicopia.util.shape.Sphere; import com.minelittlepony.unicopia.util.shape.Sphere;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.*; import net.minecraft.entity.*;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.effect.StatusEffects;
@ -36,6 +37,7 @@ import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtList;
import net.minecraft.particle.ParticleTypes; import net.minecraft.particle.ParticleTypes;
import net.minecraft.registry.RegistryWrapper.WrapperLookup; import net.minecraft.registry.RegistryWrapper.WrapperLookup;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -169,8 +171,8 @@ public class NecromancySpell extends AbstractAreaEffectSpell implements Projecti
LivingEntity master = caster.getMaster(); LivingEntity master = caster.getMaster();
summonedEntities.forEach(ref -> { summonedEntities.forEach(ref -> {
ref.ifPresent(caster.asWorld(), e -> { ref.ifPresent(caster.asWorld(), e -> {
if (master != null) { if (caster.asWorld() instanceof ServerWorld sw) {
master.applyDamageEffects(master, e); EnchantmentHelper.onTargetDamaged(sw, e, e.getDamageSources().indirectMagic(e, master));
} }
e.getWorld().sendEntityStatus(e, EntityStatuses.ADD_DEATH_PARTICLES); e.getWorld().sendEntityStatus(e, EntityStatuses.ADD_DEATH_PARTICLES);
e.discard(); e.discard();