From 5b60e9402c9d14f260d754506446955a0be6c013 Mon Sep 17 00:00:00 2001 From: Atsuishio <842960157@qq.com> Date: Sat, 12 Apr 2025 20:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=98=E6=9C=AF=E5=86=B2?= =?UTF-8?q?=E5=88=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/event/ClientEventHandler.java | 4 ---- .../superbwarfare/mixins/KeyboardInputMixin.java | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java index 407d838c6..9eafdec12 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java @@ -350,10 +350,6 @@ public class ClientEventHandler { if (zoom) { tacticalSprint = false; } - - if (tacticalSprint && player.onGround()) { - player.setDeltaMovement(player.getDeltaMovement().multiply(1.2, 1, 1.2)); - } } /** diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/KeyboardInputMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/KeyboardInputMixin.java index c4c8c1654..9f5362553 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/KeyboardInputMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/KeyboardInputMixin.java @@ -1,5 +1,6 @@ package com.atsuishio.superbwarfare.mixins; +import com.atsuishio.superbwarfare.event.ClientEventHandler; import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModMobEffects; import com.atsuishio.superbwarfare.tools.NBTTool; @@ -16,6 +17,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(KeyboardInput.class) public abstract class KeyboardInputMixin extends Input { +// @Shadow +// private static float calculateImpulse(boolean pInput, boolean pOtherInput) { +// return 0; +// } + // 按键修改mixin @Inject(method = "tick", at = @At("RETURN")) public void tick(boolean pIsSneaking, float pSneakingSpeedMultiplier, CallbackInfo ci) { @@ -23,6 +29,10 @@ public abstract class KeyboardInputMixin extends Input { Player player = mc.player; if (player == null) return; + if (ClientEventHandler.tacticalSprint && player.onGround()) { + this.forwardImpulse *= 2f; + } + ItemStack stack = player.getMainHandItem(); var tag = NBTTool.getTag(stack);