From 4e2e97486decb71f68b85f437acd36974d96dfa1 Mon Sep 17 00:00:00 2001 From: nickcat325 Date: Wed, 17 May 2023 14:30:41 -0500 Subject: [PATCH 1/2] ElytraFlight vanilla crash fix --- .../kotlin/com/lambda/client/module/modules/misc/ElytraFix.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/ElytraFix.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/ElytraFix.kt index fe53767c9..2e82d350a 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/ElytraFix.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/ElytraFix.kt @@ -35,6 +35,6 @@ object ElytraFix : Module( && entity.world.loadedEntityList .filterIsInstance() .any { - it.boostedEntity.equals(entity) + it.boostedEntity === entity } } \ No newline at end of file From c9ab4c0633884c6852c88767663adcad436c7d92 Mon Sep 17 00:00:00 2001 From: nickcat325 Date: Fri, 19 May 2023 18:25:07 -0500 Subject: [PATCH 2/2] Fixed upPitch jam --- .../module/modules/movement/ElytraFlight.kt | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/ElytraFlight.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/ElytraFlight.kt index d02e3d7b9..5d2e45fcf 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/ElytraFlight.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/ElytraFlight.kt @@ -128,9 +128,8 @@ object ElytraFlight : Module( private var boostingTick = 0 /* Vanilla mode state */ - private var lastY = 0.0 - private var shouldDescend = false - private var lastHighY = 0.0 + private var firstY = 0.0 + private var secondY = 0.0 /* Event Listeners */ init { @@ -483,26 +482,14 @@ object ElytraFlight : Module( event.cancel() } - private fun SafeClientEvent.vanillaMode() { - val playerY = player.posY - val lastShouldDescend = shouldDescend - val isBoosted = world.getLoadedEntityList().any { it is EntityFireworkRocket && it.boostedEntity == player } - - shouldDescend = lastY > playerY && lastHighY - 60 < playerY - - packetPitch = if (isBoosted) { - -rocketPitch - } else if (shouldDescend) { - if (!lastShouldDescend) { - lastHighY = playerY - } - downPitch - } else { - -upPitch - } - - lastY = playerY - } +private fun SafeClientEvent.vanillaMode() { + secondY = player.posY + packetPitch = when { + world.loadedEntityList.any { it is EntityFireworkRocket && it.boostedEntity == player } -> -rocketPitch + firstY - secondY > 0 -> downPitch + else -> -upPitch} + firstY = player.posY +} fun shouldSwing(): Boolean { return isEnabled && isFlying && !autoLanding && (mode.value == ElytraFlightMode.CONTROL || mode.value == ElytraFlightMode.PACKET) @@ -553,4 +540,4 @@ object ElytraFlight : Module( runSafe { reset(true) } } } -} +} \ No newline at end of file