Pegasi cannot pick up special entities

This commit is contained in:
Sollace 2023-09-01 18:13:39 +01:00
parent bee6d39a96
commit 1f05e46648
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -5,6 +5,7 @@ import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import com.minelittlepony.unicopia.EquinePredicates;
import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.Race;
import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.ability.data.Hit;
import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.Living;
@ -48,7 +49,7 @@ public class CarryAbility implements Ability<Hit> {
protected LivingEntity findRider(PlayerEntity player, World w) { protected LivingEntity findRider(PlayerEntity player, World w) {
return TraceHelper.<LivingEntity>findEntity(player, 10, 1, hit -> { return TraceHelper.<LivingEntity>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); }).orElse(null);
} }
@ -101,8 +102,4 @@ public class CarryAbility implements Ability<Hit> {
@Override @Override
public void coolDown(Pony player, AbilitySlot slot) { public void coolDown(Pony player, AbilitySlot slot) {
} }
public interface IPickupImmuned {
}
} }