You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privateval boostSpeed by setting("Boost", 0.0, 0.0..0.5, 0.005, description ="Speed to add when flying")
69
68
privateval rocketSpeed by setting("Rocket Speed", 1.0, 0.0..2.0, 0.01, description ="Speed multiplier that the rocket gives you")
70
69
privateval grimRocketBoost by setting("Grim Rocket Boost", true, description ="Automatically scale the firework rocket boost based on your pitch angle")
71
-
privateval maxGrimBoost by setting("Max Grim Boost", 10.0, 0.0..10.0, 0.01, description ="Maximum additional speed the firework boost can add on top of the base rocket speed") { grimRocketBoost }
70
+
privateval maxGrimBoost by setting("Max Grim Boost", 3.0, 0.0..3.0, 0.01, description ="Maximum additional speed the firework boost can add on top of the base rocket speed") { grimRocketBoost }
72
71
privateval safetyMargin by setting("Safety Margin", 0.2, 0.0..2.0, 0.01, "The time (in seconds) to shorten the firework use delay to account for ping variation", "s")
73
72
privateval mute by setting("Mute Elytra", false, "Mutes the elytra sound when gliding")
74
73
@JvmStatic val fakeFly by setting("Fake Fly", false, "Rapidly swaps the chestplate and elytra to give the appearance the player is flying without an elytra. May also reduce durability loss")
@@ -91,17 +90,14 @@ object ElytraFly : Module(
91
90
92
91
// Last sent movement packet state, used to rebuild Grim's firework prediction box.
93
92
privatevar lastMovementIncludedPosition =true
94
-
privatevar lastKnownClientVelocity =Vec3d.ZERO
95
-
privatevar hasMovementState =false
93
+
privatevar prevVelocity =Vec3d.ZERO
96
94
privatevar targetVelocity:Vec3d?=null
97
95
98
96
// Shared firework tracking. Vanilla can briefly drop the firework entity for a tick,
99
-
// so once a firework is used we hold this true until its flight duration runs out.
97
+
// so once a firework is used, we hold this true until its flight duration runs out.
100
98
privateval fireworkTimer =Timer()
101
99
privatevar lastFireworkDuration =-1.0
102
100
@JvmStatic var hasFirework =false
103
-
privatevar fireworkConfirmed =false
104
-
privatevar fireworkReady =false
105
101
106
102
init {
107
103
setDefaultAutomationConfig()
@@ -112,12 +108,9 @@ object ElytraFly : Module(
112
108
113
109
onEnable {
114
110
mode.elytraFly.onEnableListeners.forEach { it() }
115
-
lastKnownClientVelocity =Vec3d.ZERO
116
-
hasMovementState =false
111
+
prevVelocity =Vec3d.ZERO
117
112
targetVelocity =null
118
113
hasFirework =false
119
-
fireworkConfirmed =false
120
-
fireworkReady =false
121
114
fireworkTimer.reset()
122
115
lastFireworkDuration =-1.0
123
116
}
@@ -126,16 +119,10 @@ object ElytraFly : Module(
126
119
listen<TickEvent.Pre>(priority = { 1 }) {
127
120
if (!player.isGliding) {
128
121
hasFirework =false
129
-
fireworkConfirmed =false
130
-
fireworkReady =false
131
122
return@listen
132
123
}
133
124
if (fireworkTimer.timePassed((lastFireworkDuration - safetyMargin).seconds)) {
134
125
hasFirework =false
135
-
fireworkConfirmed =false
136
-
fireworkReady =false
137
-
} elseif (player.hasFirework) {
138
-
fireworkConfirmed =true
139
126
}
140
127
}
141
128
@@ -151,22 +138,19 @@ object ElytraFly : Module(
151
138
152
139
listen<TickEvent.Pre> {
153
140
if (!grimRocketBoost) return@listen
154
-
if (!player.isGliding ||!hasFirework ||!fireworkConfirmed ||!fireworkReady ||!hasMovementState) return@listen
141
+
if (!player.isGliding ||!hasFirework ||mode.elytraFly.pausingMovement()) return@listen
155
142
156
143
val aiming =Vec3d.fromPolar(
157
144
RotationManager.movementPitch ?: player.pitch,
158
145
RotationManager.movementYaw ?: player.yaw,
159
146
)
160
-
val serverRot =RotationManager.serverRotation
161
-
val bounds =GrimFireworkBox.computeFireworksBounds(
162
-
lastKnownClientVelocity,
163
-
aiming,
164
-
serverRot.pitchF,
165
-
serverRot.yawF,
166
-
lastMovementIncludedPosition,
167
-
EXPLOIT_RESCALE,
168
-
player.finalGravity,
169
-
) ?:return@listen
147
+
val bounds =
148
+
GrimFireworkBox.getFireworkBounds(
149
+
prevVelocity,
150
+
aiming,
151
+
lastMovementIncludedPosition,
152
+
EXPLOIT_RESCALE
153
+
) ?:return@listen
170
154
val claimed = farthestPointInBox(bounds, aiming)?.let { limitSpeed(it) } ?:return@listen
171
155
172
156
targetVelocity = claimed
@@ -179,11 +163,9 @@ object ElytraFly : Module(
179
163
val prevPos = player.prevPos
180
164
val next =Vec3d(packet.getX(prevPos.x), packet.getY(prevPos.y), packet.getZ(prevPos.z))
181
165
val delta = next.subtract(prevPos)
182
-
if (hasMovementState) lastKnownClientVelocity = delta
0 commit comments