From ddc00804f1d2f909eae4461fb8d2e7571be107fc Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 25 Aug 2023 14:59:49 +0200 Subject: Auto Sprint --- .../java/moe/nea/firmament/mixins/MixinKeyBinding.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java (limited to 'src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java') diff --git a/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java b/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java new file mode 100644 index 0000000..c057a93 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java @@ -0,0 +1,16 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.features.fixes.Fixes; +import net.minecraft.client.option.KeyBinding; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(KeyBinding.class) +public class MixinKeyBinding { + @Inject(method = "isPressed", at = @At("HEAD"), cancellable = true) + public void onIsPressed(CallbackInfoReturnable cir) { + Fixes.INSTANCE.handleIsPressed((KeyBinding) (Object) this, cir); + } +} -- cgit