diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt | 13 |
1 files changed, 13 insertions, 0 deletions
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<Boolean> + ) { + if (keyBinding === MinecraftClient.getInstance().options.sprintKey && TConfig.autoSprint && MC.player?.isSprinting != true) + cir.returnValue = true + } + override fun onLoad() { } } |