From e03fb016d51a3f9857ad2ca1f3ef0efc7d7bef3f Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 27 Feb 2024 21:20:33 +0000 Subject: [PATCH] Fixed shields not deflecting projectiles --- .../java/com/minelittlepony/unicopia/EquinePredicates.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java index deedb819..de83f274 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java +++ b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java @@ -11,6 +11,7 @@ import com.minelittlepony.unicopia.item.enchantment.WantItNeedItEnchantment; import net.minecraft.entity.*; import net.minecraft.entity.decoration.AbstractDecorationEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.ProjectileEntity; import net.minecraft.entity.vehicle.BoatEntity; import net.minecraft.predicate.entity.EntityPredicates; @@ -34,7 +35,11 @@ public interface EquinePredicates { Predicate IS_CASTER = e -> !e.isRemoved() && (e instanceof Caster || IS_PLAYER.test(e)); Predicate IS_PLACED_SPELL = e -> e instanceof Caster && !e.isRemoved(); - Predicate IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) && !(e instanceof ItemEntity) && !(e instanceof ExperienceOrbEntity) && !(e instanceof BoatEntity); + Predicate IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) + && !(e instanceof ItemEntity) + && !(e instanceof ExperienceOrbEntity) + && !(e instanceof BoatEntity) + && !(e instanceof ProjectileEntity); Predicate EXCEPT_MAGIC_IMMUNE = IS_MAGIC_IMMUNE.negate(); Predicate VALID_LIVING_AND_NOT_MAGIC_IMMUNE = EntityPredicates.VALID_LIVING_ENTITY.and(EXCEPT_MAGIC_IMMUNE);