Skip to content

Commit daad564

Browse files
committed
cleanup
1 parent 20afb4e commit daad564

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ object ElytraAltitudeControl : Module(
100100
run {
101101
when (controlState) {
102102
ControlState.AttitudeControl -> {
103-
if (disableOnFirework && player.hasFirework) {
103+
if (disableOnFirework && hasFirework) {
104104
return@run
105105
}
106106
if (usePitch40OnHeight) {
@@ -120,7 +120,7 @@ object ElytraAltitudeControl : Module(
120120
}.coerceIn(-maxPitchAngle, maxPitchAngle)
121121
rotationRequest { pitch(outputPitch) }.submit()
122122

123-
if (usageDelay.timePassed(2.seconds) && !player.hasFirework) {
123+
if (usageDelay.timePassed(2.seconds) && !hasFirework) {
124124
if (useFireworkOnHeight && minHeight > player.y) {
125125
usageDelay.reset()
126126
runSafe {
@@ -191,8 +191,8 @@ object ElytraAltitudeControl : Module(
191191
}
192192
}
193193

194-
val ClientPlayerEntity.hasFirework: Boolean
195-
get() = runSafe { return fastEntitySearch<FireworkRocketEntity>(4.0) { it.shooter == this.player }.any() } ?: false
194+
val hasFirework: Boolean
195+
get() = runSafe { return fastEntitySearch<FireworkRocketEntity>(4.0) { it.shooter == player }.any() } ?: false
196196

197197
class PIController(val valueP: () -> Double, val valueD: () -> Double, val valueI: () -> Double, val constant: () -> Double) {
198198
var accumulator = 0.0 // Integral term accumulator

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,19 @@ object ElytraFly : Module(
7171

7272
listen<TickEvent.Pre> {
7373
if (mode != FlyMode.Bounce) return@listen
74-
if (autoPitch) {
75-
rotationRequest {
76-
pitch(pitch.toFloat())
77-
}.submit()
78-
}
74+
if (autoPitch) rotationRequest { pitch(pitch.toFloat()) }.submit()
7975

8076
if (!player.isGliding) {
8177
if (takeoff && player.canTakeoff) {
8278
if (player.canOpenElytra) {
8379
player.startGliding()
8480
startFlyPacket()
85-
};
86-
else jumpThisTick = true
81+
} else jumpThisTick = true
8782
}
8883
return@listen
8984
}
9085

91-
if (mode == FlyMode.Bounce) startFlyPacket()
86+
startFlyPacket()
9287
}
9388

9489
listen<TickEvent.Post> {

0 commit comments

Comments
 (0)