mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed alicorn amulet flight not working
This commit is contained in:
parent
f0270be985
commit
222e208141
3 changed files with 9 additions and 1 deletions
|
@ -42,6 +42,10 @@ public enum FlightType {
|
|||
return this == INSECTOID ? 0.66F : 1;
|
||||
}
|
||||
|
||||
public FlightType or(FlightType other) {
|
||||
return ordinal() > other.ordinal() ? this : other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Predicate for abilities to control whether a player can fly.
|
||||
*
|
||||
|
|
|
@ -220,6 +220,10 @@ public record Race (Supplier<Composite> compositeSupplier, boolean canCast, Flig
|
|||
public boolean canCast() {
|
||||
return any(Race::canCast);
|
||||
}
|
||||
|
||||
public FlightType flightType() {
|
||||
return physical().flightType().or(pseudo().flightType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
|||
.filter(effect -> !effect.isDead() && effect instanceof FlightType.Provider)
|
||||
.map(effect -> ((FlightType.Provider)effect).getFlightType())
|
||||
.filter(FlightType::isPresent)
|
||||
.orElse(pony.getObservedSpecies().flightType());
|
||||
.orElse(pony.getCompositeRace().flightType());
|
||||
}
|
||||
|
||||
public void cancelFlight(boolean force) {
|
||||
|
|
Loading…
Reference in a new issue