Skip to content

Commit 322a091

Browse files
committed
fix(pitch40): working without elytra
1 parent 94a8f3c commit 322a091

File tree

1 file changed

+12
-3
lines changed
  • src/main/kotlin/com/lambda/module/modules/movement

1 file changed

+12
-3
lines changed

src/main/kotlin/com/lambda/module/modules/movement/Pitch40.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ object Pitch40 : Module(
5757
}
5858

5959
listen<TickEvent.Pre> {
60+
if (!player.isGliding) {
61+
reset(player)
62+
return@listen
63+
}
64+
6065
when (state) {
6166
Pitch40State.GainSpeed -> {
6267
lookAt(Rotation(player.yaw, PITCH_DOWN_DEFAULT)).requestBy(this@Pitch40)
@@ -87,12 +92,16 @@ object Pitch40 : Module(
8792
}
8893

8994
onEnable {
90-
state = Pitch40State.GainSpeed
91-
lastPos = player.pos
92-
lastAngle = PITCH_UP_DEFAULT
95+
reset(player)
9396
}
9497
}
9598

99+
fun reset(player: ClientPlayerEntity) {
100+
state = Pitch40State.GainSpeed
101+
lastPos = player.pos
102+
lastAngle = PITCH_UP_DEFAULT
103+
}
104+
96105
/**
97106
* Get the player's current speed in meters per second.
98107
*/

0 commit comments

Comments
 (0)