File tree Expand file tree Collapse file tree 1 file changed +11
-24
lines changed
src/main/kotlin/com/lambda/client/module/modules/movement Expand file tree Collapse file tree 1 file changed +11
-24
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,8 @@ object ElytraFlight : Module(
128128 private var boostingTick = 0
129129
130130 /* Vanilla mode state */
131- private var lastY = 0.0
132- private var shouldDescend = false
133- private var lastHighY = 0.0
131+ private var firstY = 0.0
132+ private var secondY = 0.0
134133
135134 /* Event Listeners */
136135 init {
@@ -483,26 +482,14 @@ object ElytraFlight : Module(
483482 event.cancel()
484483 }
485484
486- private fun SafeClientEvent.vanillaMode () {
487- val playerY = player.posY
488- val lastShouldDescend = shouldDescend
489- val isBoosted = world.getLoadedEntityList().any { it is EntityFireworkRocket && it.boostedEntity == player }
490-
491- shouldDescend = lastY > playerY && lastHighY - 60 < playerY
492-
493- packetPitch = if (isBoosted) {
494- - rocketPitch
495- } else if (shouldDescend) {
496- if (! lastShouldDescend) {
497- lastHighY = playerY
498- }
499- downPitch
500- } else {
501- - upPitch
502- }
503-
504- lastY = playerY
505- }
485+ private fun SafeClientEvent.vanillaMode () {
486+ secondY = player.posY
487+ packetPitch = when {
488+ world.loadedEntityList.any { it is EntityFireworkRocket && it.boostedEntity == player } -> - rocketPitch
489+ firstY - secondY > 0 -> downPitch
490+ else -> - upPitch}
491+ firstY = player.posY
492+ }
506493
507494 fun shouldSwing (): Boolean {
508495 return isEnabled && isFlying && ! autoLanding && (mode.value == ElytraFlightMode .CONTROL || mode.value == ElytraFlightMode .PACKET )
@@ -553,4 +540,4 @@ object ElytraFlight : Module(
553540 runSafe { reset(true ) }
554541 }
555542 }
556- }
543+ }
You can’t perform that action at this time.
0 commit comments