From ddc00804f1d2f909eae4461fb8d2e7571be107fc Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 25 Aug 2023 14:59:49 +0200 Subject: Auto Sprint --- src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/kotlin/moe/nea/firmament') diff --git a/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt b/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt index 77397bc..1077f31 100644 --- a/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt +++ b/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt @@ -8,6 +8,10 @@ package moe.nea.firmament.features.fixes import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.util.MC +import net.minecraft.client.MinecraftClient +import net.minecraft.client.option.KeyBinding +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable object Fixes : FirmamentFeature { override val identifier: String @@ -15,11 +19,20 @@ object Fixes : FirmamentFeature { object TConfig : ManagedConfig(identifier) { val fixUnsignedPlayerSkins by toggle("player-skins") { true } + val autoSprint by toggle("auto-sprint") { false } } override val config: ManagedConfig get() = TConfig + fun handleIsPressed( + keyBinding: KeyBinding, + cir: CallbackInfoReturnable + ) { + if (keyBinding === MinecraftClient.getInstance().options.sprintKey && TConfig.autoSprint && MC.player?.isSprinting != true) + cir.returnValue = true + } + override fun onLoad() { } } -- cgit