Fixed server flight state desync. Fixes #430, Fixes #421 (probably, cannot reproduce)

This commit is contained in:
Sollace 2024-09-16 15:30:46 +01:00
parent 661a025e81
commit 0eb0b99a60
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -243,7 +243,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
public void tick() { public void tick() {
super.tick(); super.tick();
if (pony.isClientPlayer() && isFlying() && (pony.getJumpingHeuristic().hasChanged(Heuristic.ONCE) || pony.sneakingChanged())) { if (pony.isClientPlayer() && (pony.getJumpingHeuristic().hasChanged(Heuristic.ONCE) || pony.sneakingChanged())) {
Channel.FLIGHT_CONTROLS_INPUT.sendToServer(new MsgPlayerFlightControlsInput(pony)); Channel.FLIGHT_CONTROLS_INPUT.sendToServer(new MsgPlayerFlightControlsInput(pony));
} }
@ -370,7 +370,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
pony.getMagicalReserves().getCharge().set(0); pony.getMagicalReserves().getCharge().set(0);
} }
if (!creative) { if (!creative && !pony.isClient()) {
checkAvianTakeoffConditions(velocity); checkAvianTakeoffConditions(velocity);
} }
} }