修改战术冲刺
This commit is contained in:
parent
37cdc7246a
commit
5b60e9402c
2 changed files with 10 additions and 4 deletions
|
@ -350,10 +350,6 @@ public class ClientEventHandler {
|
||||||
if (zoom) {
|
if (zoom) {
|
||||||
tacticalSprint = false;
|
tacticalSprint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tacticalSprint && player.onGround()) {
|
|
||||||
player.setDeltaMovement(player.getDeltaMovement().multiply(1.2, 1, 1.2));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.atsuishio.superbwarfare.mixins;
|
package com.atsuishio.superbwarfare.mixins;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.event.ClientEventHandler;
|
||||||
import com.atsuishio.superbwarfare.init.ModItems;
|
import com.atsuishio.superbwarfare.init.ModItems;
|
||||||
import com.atsuishio.superbwarfare.init.ModMobEffects;
|
import com.atsuishio.superbwarfare.init.ModMobEffects;
|
||||||
import com.atsuishio.superbwarfare.tools.NBTTool;
|
import com.atsuishio.superbwarfare.tools.NBTTool;
|
||||||
|
@ -16,6 +17,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
@Mixin(KeyboardInput.class)
|
@Mixin(KeyboardInput.class)
|
||||||
public abstract class KeyboardInputMixin extends Input {
|
public abstract class KeyboardInputMixin extends Input {
|
||||||
|
|
||||||
|
// @Shadow
|
||||||
|
// private static float calculateImpulse(boolean pInput, boolean pOtherInput) {
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
|
||||||
// 按键修改mixin
|
// 按键修改mixin
|
||||||
@Inject(method = "tick", at = @At("RETURN"))
|
@Inject(method = "tick", at = @At("RETURN"))
|
||||||
public void tick(boolean pIsSneaking, float pSneakingSpeedMultiplier, CallbackInfo ci) {
|
public void tick(boolean pIsSneaking, float pSneakingSpeedMultiplier, CallbackInfo ci) {
|
||||||
|
@ -23,6 +29,10 @@ public abstract class KeyboardInputMixin extends Input {
|
||||||
Player player = mc.player;
|
Player player = mc.player;
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
|
|
||||||
|
if (ClientEventHandler.tacticalSprint && player.onGround()) {
|
||||||
|
this.forwardImpulse *= 2f;
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack stack = player.getMainHandItem();
|
ItemStack stack = player.getMainHandItem();
|
||||||
var tag = NBTTool.getTag(stack);
|
var tag = NBTTool.getTag(stack);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue