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);