修复射击bug

This commit is contained in:
Atsuihsio 2025-01-30 14:16:28 +08:00
parent 7fe770bf1b
commit 066c123252

View file

@ -340,7 +340,6 @@ public class LivingEventHandler {
player.getCapability(ModCapabilities.LASER_CAPABILITY).ifPresent(LaserCapability.ILaserCapability::stop);
if (player instanceof ServerPlayer serverPlayer) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new DrawClientMessage(true));
if (newStack.getItem() != oldStack.getItem()
|| newStack.getTag() == null || oldStack.getTag() == null
|| (newStack.is(ModTags.Items.GUN) && !GunsTool.getGunData(newStack).hasUUID("UUID"))
@ -422,6 +421,10 @@ public class LivingEventHandler {
GunsTool.setPerkIntTag(newStack, "KillingTally", 0);
}
if (player.level() instanceof ServerLevel) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new DrawClientMessage(true));
}
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
capability.tacticalSprint = false;
capability.syncPlayerVariables(player);