优化战术冲刺设置判定

This commit is contained in:
Light_Quanta 2025-04-19 03:02:01 +08:00
parent a872942a72
commit fc16707199
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
4 changed files with 11 additions and 8 deletions

View file

@ -51,7 +51,7 @@ public class MinigunItemModel extends GeoModel<MinigunItem> {
int rpm = GunData.from(stack).rpm();
gun.setRotZ((float) (gun.getRotZ() + times * -0.07f * ((float) rpm / 1200) * ClientEventHandler.shootDelay));
gun.setRotZ(gun.getRotZ() + times * -0.07f * ((float) rpm / 1200) * ClientEventHandler.shootDelay);
shen.setPosX((float) (0.75f * ClientEventHandler.recoilHorizon * fpz * fp));
shen.setPosY((float) (-0.03f * fp - 0.06f * fr));

View file

@ -314,11 +314,13 @@ public class ClientEventHandler {
return;
}
tacticalSprint = !exhaustion && !zoom && isMoving() && player.isSprinting() && player.getVehicle() == null && !player.getAbilities().flying;
if (!MiscConfig.ALLOW_TACTICAL_SPRINT.get()) {
tacticalSprint = false;
}
tacticalSprint = MiscConfig.ALLOW_TACTICAL_SPRINT.get()
&& !exhaustion
&& !zoom
&& isMoving()
&& player.isSprinting()
&& player.getVehicle() == null
&& !player.getAbilities().flying;
ItemStack stack = player.getMainHandItem();

View file

@ -164,7 +164,7 @@ public class PlayerEventHandler {
attr.removeModifier(TACTICAL_SPRINT);
}
if (player.getData(ModAttachments.PLAYER_VARIABLE).tacticalSprint) {
if (MiscConfig.ALLOW_TACTICAL_SPRINT.get() && player.getData(ModAttachments.PLAYER_VARIABLE).tacticalSprint) {
player.setSprinting(true);
attr.addTransientModifier(new AttributeModifier(TACTICAL_SPRINT, 0.25, AttributeModifier.Operation.ADD_MULTIPLIED_BASE));
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.network.message.send;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.config.server.MiscConfig;
import com.atsuishio.superbwarfare.init.ModAttachments;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
@ -22,7 +23,7 @@ public record TacticalSprintMessage(boolean sprint) implements CustomPacketPaylo
var player = context.player();
var cap = player.getData(ModAttachments.PLAYER_VARIABLE).watch();
cap.tacticalSprint = message.sprint;
cap.tacticalSprint = MiscConfig.ALLOW_TACTICAL_SPRINT.get() && message.sprint;
cap.sync(player);
}