From 75a691245913bfab3b7627a1d41e6ec6a6b095e2 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 1 Sep 2023 18:16:52 +0100 Subject: [PATCH] Fixed pegasi not being able to fly when wearing the unicorn amulet --- .../minelittlepony/unicopia/entity/player/PlayerPhysics.java | 2 +- .../java/com/minelittlepony/unicopia/entity/player/Pony.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index c3326252..30ad9e53 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -194,7 +194,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab .filter(effect -> !effect.isDead() && effect instanceof FlightType.Provider) .map(effect -> ((FlightType.Provider)effect).getFlightType()) .filter(FlightType::isPresent) - .orElse(pony.getSpecies().flightType()); + .orElse(pony.getObservedSpecies().flightType()); } public void cancelFlight(boolean force) { diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 2ab2efe7..810b468a 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -193,7 +193,10 @@ public class Pony extends Living implements Copyable, Update * Gets this player's species as it appears when interacting physically with other players or the world. * This includes temporary race swaps due to illusions/shape shifting as well as artifacts that merely * grant the abilities of a race, such as the alicorn amulet. + * + * @deprecated Use {@link Pony#getCompositeRace()} or {@link Pony#getObservedSpecies()} */ + @Deprecated @Override public Race getSpecies() { if (AmuletSelectors.ALICORN_AMULET.test(entity)) { @@ -217,7 +220,7 @@ public class Pony extends Living implements Copyable, Update .map(EntityAppearance::getAppearance) .flatMap(Pony::of) .map(Pony::getActualSpecies) - .orElse(getActualSpecies()); + .orElseGet(this::getActualSpecies); } /**