diff --git a/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/entity/MixinClientPlayerEntity.java b/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/entity/MixinClientPlayerEntity.java index d854e4a12546..a0f7b52495f3 100644 --- a/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/entity/MixinClientPlayerEntity.java +++ b/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/entity/MixinClientPlayerEntity.java @@ -36,6 +36,7 @@ import net.ccbluex.liquidbounce.features.module.modules.render.ModuleNoSwing; import net.ccbluex.liquidbounce.features.module.modules.render.ModuleRotations; import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleScaffold; +import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.features.ScaffoldSprintFeature; import net.ccbluex.liquidbounce.integration.interop.protocol.rest.v1.game.PlayerData; import net.ccbluex.liquidbounce.utils.aiming.Rotation; import net.ccbluex.liquidbounce.utils.aiming.RotationManager; @@ -296,7 +297,7 @@ private float hookSprintIgnoreHunger(float constant) { @ModifyReturnValue(method = "canSprint", at = @At("RETURN")) private boolean injectScaffoldSprintValue(boolean original) { - return original && (!ModuleScaffold.INSTANCE.handleEvents() || ModuleScaffold.INSTANCE.getAllowSprinting()); + return original && (!ModuleScaffold.INSTANCE.handleEvents() || ScaffoldSprintFeature.INSTANCE.handleEvents()); } @ModifyExpressionValue(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/KeyBinding;isPressed()Z")) @@ -332,7 +333,8 @@ private boolean isOmniWalking() { target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSprinting()Z") ) private boolean hookNoHungerSprint(boolean original) { - return !(ModuleAntiHunger.INSTANCE.getEnabled() && ModuleAntiHunger.INSTANCE.getNoSprint()) && original; + return original + && !(ModuleAntiHunger.INSTANCE.getEnabled() && ModuleAntiHunger.INSTANCE.getNoSprint()) + && !(ScaffoldSprintFeature.INSTANCE.handleEvents() && ScaffoldSprintFeature.INSTANCE.getSpoof()); } - } diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/ModuleScaffold.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/ModuleScaffold.kt index 6b04149dea6d..2664f4c6ca26 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/ModuleScaffold.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/ModuleScaffold.kt @@ -96,9 +96,9 @@ object ModuleScaffold : Module("Scaffold", Category.WORLD) { private var delay by intRange("Delay", 0..0, 0..40, "ticks") private val minDist by float("MinDist", 0.0f, 0.0f..0.25f) private val timer by float("Timer", 1f, 0.01f..10f) - val allowSprinting by boolean("AllowSprinting", true) init { + tree(ScaffoldSprintFeature) tree(ScaffoldAutoBlockFeature) tree(ScaffoldMovementPrediction) } diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/features/ScaffoldSprintFeature.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/features/ScaffoldSprintFeature.kt new file mode 100644 index 000000000000..fffa9af92556 --- /dev/null +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/features/ScaffoldSprintFeature.kt @@ -0,0 +1,8 @@ +package net.ccbluex.liquidbounce.features.module.modules.world.scaffold.features + +import net.ccbluex.liquidbounce.config.ToggleableConfigurable +import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleScaffold + +object ScaffoldSprintFeature : ToggleableConfigurable(ModuleScaffold, "Sprint", true) { + val spoof by boolean("Spoof", false) +}