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 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..13d7e12a9 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 { @@ -484,24 +483,13 @@ object ElytraFlight : Module( } 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 + secondY = player.posY + packetPitch = when { + world.loadedEntityList.any { it is EntityFireworkRocket && it.boostedEntity == player } -> -rocketPitch + firstY - secondY > 0 -> downPitch + else -> -upPitch } - - lastY = playerY + firstY = player.posY } fun shouldSwing(): Boolean { @@ -553,4 +541,4 @@ object ElytraFlight : Module( runSafe { reset(true) } } } -} +} \ No newline at end of file