From 8f2cd29488310d7a5063e9d81cfc5cf84df5b346 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 28 Sep 2023 21:54:30 +0100 Subject: [PATCH] Prevent sombra from targetting things it shouldn't --- .../com/minelittlepony/unicopia/entity/mob/SombraEntity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/SombraEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/SombraEntity.java index d280b586..26714449 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/SombraEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/SombraEntity.java @@ -7,6 +7,7 @@ import java.util.stream.Stream; import org.jetbrains.annotations.Nullable; import com.google.common.collect.ImmutableSet; +import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.spell.AbstractDisguiseSpell; import com.minelittlepony.unicopia.advancement.UCriteria; @@ -579,7 +580,9 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti @Override public boolean canTarget(LivingEntity target) { - if (target instanceof PlayerEntity player && (player.isCreative() || player.isSpectator())) { + if (target instanceof SombraEntity + || EquinePredicates.IS_MAGIC_IMMUNE.test(target) + || !EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR.test(target)) { return false; }