Fixed pegasi not being able to fly when wearing the unicorn amulet

This commit is contained in:
Sollace 2023-09-01 18:16:52 +01:00
parent a5aedf6c64
commit 75a6912459
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 5 additions and 2 deletions

View file

@ -194,7 +194,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
.filter(effect -> !effect.isDead() && effect instanceof FlightType.Provider) .filter(effect -> !effect.isDead() && effect instanceof FlightType.Provider)
.map(effect -> ((FlightType.Provider)effect).getFlightType()) .map(effect -> ((FlightType.Provider)effect).getFlightType())
.filter(FlightType::isPresent) .filter(FlightType::isPresent)
.orElse(pony.getSpecies().flightType()); .orElse(pony.getObservedSpecies().flightType());
} }
public void cancelFlight(boolean force) { public void cancelFlight(boolean force) {

View file

@ -193,7 +193,10 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
* Gets this player's species as it appears when interacting physically with other players or the world. * 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 * 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. * grant the abilities of a race, such as the alicorn amulet.
*
* @deprecated Use {@link Pony#getCompositeRace()} or {@link Pony#getObservedSpecies()}
*/ */
@Deprecated
@Override @Override
public Race getSpecies() { public Race getSpecies() {
if (AmuletSelectors.ALICORN_AMULET.test(entity)) { if (AmuletSelectors.ALICORN_AMULET.test(entity)) {
@ -217,7 +220,7 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
.map(EntityAppearance::getAppearance) .map(EntityAppearance::getAppearance)
.flatMap(Pony::of) .flatMap(Pony::of)
.map(Pony::getActualSpecies) .map(Pony::getActualSpecies)
.orElse(getActualSpecies()); .orElseGet(this::getActualSpecies);
} }
/** /**