修改战术冲刺

This commit is contained in:
Atsuishio 2025-04-12 20:36:34 +08:00 committed by Light_Quanta
parent 37cdc7246a
commit 5b60e9402c
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
2 changed files with 10 additions and 4 deletions

View file

@ -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));
}
}
/**

View file

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