File tree Expand file tree Collapse file tree 2 files changed +10
-22
lines changed
src/main/kotlin/com/lambda/client/module/modules Expand file tree Collapse file tree 2 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,6 @@ object ElytraFix : Module(
35
35
&& entity.world.loadedEntityList
36
36
.filterIsInstance<AccessorEntityFireworkRocket >()
37
37
.any {
38
- it.boostedEntity.equals( entity)
38
+ it.boostedEntity == = entity
39
39
}
40
40
}
Original file line number Diff line number Diff line change @@ -128,9 +128,8 @@ object ElytraFlight : Module(
128
128
private var boostingTick = 0
129
129
130
130
/* 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
134
133
135
134
/* Event Listeners */
136
135
init {
@@ -484,24 +483,13 @@ object ElytraFlight : Module(
484
483
}
485
484
486
485
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
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
502
491
}
503
-
504
- lastY = playerY
492
+ firstY = player.posY
505
493
}
506
494
507
495
fun shouldSwing (): Boolean {
@@ -553,4 +541,4 @@ object ElytraFlight : Module(
553
541
runSafe { reset(true ) }
554
542
}
555
543
}
556
- }
544
+ }
You can’t perform that action at this time.
0 commit comments