Skip to content

Commit 8d85050

Browse files
committed
fix fireworks slowing you down on use
1 parent 6436240 commit 8d85050

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/main/java/com/lambda/mixin/entity/FireworkRocketEntityMixin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
public class FireworkRocketEntityMixin {
3131
@WrapOperation(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V"))
3232
private void wrapSetVelocity(LivingEntity shooter, Vec3d vec3d, Operation<Void> original) {
33-
if (ElytraFly.INSTANCE.isEnabled()) ElytraFly.boostRocket();
34-
else original.call(shooter, vec3d);
33+
if (ElytraFly.INSTANCE.isDisabled()) {
34+
original.call(shooter, vec3d);
35+
return;
36+
}
37+
if (ElytraFly.getRocketBoostMode() == ElytraFly.RocketBoostMode.Grim) return;
38+
ElytraFly.boostRocket();
3539
}
3640
}

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import com.lambda.module.modules.movement.elytrafly.modes.GeneralElytraFly
3636
import com.lambda.module.modules.movement.elytrafly.modes.GrimControlElytraFly
3737
import com.lambda.module.tag.ModuleTag
3838
import com.lambda.threading.runSafe
39+
import com.lambda.util.NamedEnum
3940
import com.lambda.util.Timer
4041
import com.lambda.util.extension.isElytraFlying
4142
import com.lambda.util.extension.prevPos
@@ -65,10 +66,15 @@ object ElytraFly : Module(
6566
to.elytraFly.onEnableListeners.forEach { it() }
6667
}
6768

69+
enum class RocketBoostMode(override val displayName: String): NamedEnum {
70+
Standard("$this"),
71+
Grim("$this")
72+
}
73+
6874
private val boostSpeed by setting("Boost", 0.0, 0.0..0.5, 0.005, description = "Speed to add when flying")
69-
private val rocketSpeed by setting("Rocket Speed", 1.0, 0.0..2.0, 0.01, description = "Speed multiplier that the rocket gives you")
70-
private val grimRocketBoost by setting("Grim Rocket Boost", true, description = "Automatically scale the firework rocket boost based on your pitch angle")
71-
private val 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 }
75+
@JvmStatic val rocketBoostMode by setting("Rocket Boost Mode", RocketBoostMode.Grim)
76+
private val rocketSpeed by setting("Rocket Speed", 1.0, 0.0..2.0, 0.01, description = "Speed multiplier that the rocket gives you") { rocketBoostMode == RocketBoostMode.Standard }
77+
private val 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") { rocketBoostMode == RocketBoostMode.Grim }
7278
private val 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")
7379
private val mute by setting("Mute Elytra", false, "Mutes the elytra sound when gliding")
7480
@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")
@@ -78,7 +84,8 @@ object ElytraFly : Module(
7884
private const val GRIM_CONTROL_TAB = "Grim Control"
7985
// private const val PACKET_TAB = "Packet"
8086
private const val GENERAL_TAB = "None"
81-
private const val EXPLOIT_RESCALE = 1.65
87+
88+
private const val GRIM_ROCKET_BOOST_RESCALE = 1.65
8289

8390
@Tab(GENERAL_TAB) @JvmStatic val generalMode by configBlock(GeneralElytraFly(this))
8491
.withEdits { forEachSetting { visibility { old -> { old() && mode == FlyMode.General } } } }
@@ -136,7 +143,7 @@ object ElytraFly : Module(
136143
}
137144

138145
listen<TickEvent.Pre> {
139-
if (!grimRocketBoost) return@listen
146+
if (rocketBoostMode != RocketBoostMode.Grim) return@listen
140147
if (!player.isGliding || !hasFirework || mode.elytraFly.pausingMovement()) return@listen
141148

142149
val aiming = Vec3d.fromPolar(
@@ -148,7 +155,7 @@ object ElytraFly : Module(
148155
prevVelocity,
149156
aiming,
150157
lastMovementIncludedPosition,
151-
EXPLOIT_RESCALE
158+
GRIM_ROCKET_BOOST_RESCALE
152159
) ?: return@listen
153160
val claimed = farthestPointInBox(bounds, aiming)?.let { limitSpeed(it) } ?: return@listen
154161

src/main/kotlin/com/lambda/module/modules/movement/elytrafly/modes/GrimControlElytraFly.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class GrimControlElytraFly(
4747
override val c: Config
4848
) : ElytraFlyMode(FlyMode.GrimControl) {
4949
private val inventory by c.setting("Inventory", true, "Allow using fireworks from the players inventory")
50-
private val upDownAngle by c.setting("Up/Down Angle", 33f, 0f..90f, 0.1f)
50+
private val upDownAngle by c.setting("Up/Down Angle", 20f, 0f..90f, 0.1f)
5151
val flipFlopMode by c.setting("Flip Flop Mode", FlipFlopMode.None)
5252
private val packetGap by c.setting("Packet Gap", 20, 0..100, 1, "The gap between allowing player movement packets to pass") { flipFlopMode != FlipFlopMode.None }
5353

0 commit comments

Comments
 (0)