From 1f05e4664869102591bc692af2022dbcf5efffb2 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 1 Sep 2023 18:13:39 +0100 Subject: [PATCH] Pegasi cannot pick up special entities --- .../com/minelittlepony/unicopia/ability/CarryAbility.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/CarryAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/CarryAbility.java index ffde5913..6b672436 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/CarryAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/CarryAbility.java @@ -5,6 +5,7 @@ import java.util.Optional; import java.util.UUID; import java.util.stream.StreamSupport; +import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.entity.Living; @@ -48,7 +49,7 @@ public class CarryAbility implements Ability { protected LivingEntity findRider(PlayerEntity player, World w) { return TraceHelper.findEntity(player, 10, 1, hit -> { - return hit instanceof LivingEntity && !player.isConnectedThroughVehicle(hit) && !(hit instanceof IPickupImmuned); + return EquinePredicates.EXCEPT_MAGIC_IMMUNE.test(hit) && !player.isConnectedThroughVehicle(hit); }).orElse(null); } @@ -101,8 +102,4 @@ public class CarryAbility implements Ability { @Override public void coolDown(Pony player, AbilitySlot slot) { } - - public interface IPickupImmuned { - - } }