mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed random boosts whilst flying
This commit is contained in:
parent
4404b4108d
commit
75a0c4d769
1 changed files with 7 additions and 4 deletions
|
@ -537,7 +537,8 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyThrust(MutableVector velocity) {
|
private void applyThrust(MutableVector velocity) {
|
||||||
if (pony.sneakingChanged() && entity.isSneaking()) {
|
boolean manualFlap = pony.sneakingChanged() && entity.isSneaking();
|
||||||
|
if (manualFlap) {
|
||||||
flapping = true;
|
flapping = true;
|
||||||
ticksToGlide = MAX_TICKS_TO_GLIDE;
|
ticksToGlide = MAX_TICKS_TO_GLIDE;
|
||||||
}
|
}
|
||||||
|
@ -552,9 +553,11 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
||||||
entity.playSound(getFlightType().getWingFlapSound(), 0.5F, 1);
|
entity.playSound(getFlightType().getWingFlapSound(), 0.5F, 1);
|
||||||
entity.world.emitGameEvent(entity, GameEvent.ELYTRA_GLIDE, entity.getPos());
|
entity.world.emitGameEvent(entity, GameEvent.ELYTRA_GLIDE, entity.getPos());
|
||||||
}
|
}
|
||||||
if (!hovering) {
|
thrustScale = 1;
|
||||||
thrustScale = 1;
|
if (manualFlap) {
|
||||||
descentRate -= 0.5F;
|
descentRate -= 0.5;
|
||||||
|
} else {
|
||||||
|
descentRate = Math.max(0, descentRate / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue