From 9bd529277f5025805da95f081657c180972e487e Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 16 Dec 2025 05:38:10 -0530 Subject: fix packet order for attacking and sprinting --- azalea-client/src/plugins/attack.rs | 3 ++- azalea-client/src/plugins/movement.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'azalea-client/src/plugins') diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs index eca41503..baab4333 100644 --- a/azalea-client/src/plugins/attack.rs +++ b/azalea-client/src/plugins/attack.rs @@ -32,9 +32,10 @@ impl Plugin for AttackPlugin { ( increment_ticks_since_last_attack, update_attack_strength_scale.after(PhysicsSystems), + // in vanilla, handle_attack_queued is part of `handleKeybinds` handle_attack_queued + .before(super::movement::send_sprinting_if_needed) .before(super::tick_end::game_tick_packet) - .after(super::movement::send_sprinting_if_needed) .before(super::movement::send_position), ) .chain(), diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs index 15d4a468..fd85de2d 100644 --- a/azalea-client/src/plugins/movement.rs +++ b/azalea-client/src/plugins/movement.rs @@ -25,7 +25,7 @@ use azalea_protocol::{ s_move_player_pos::ServerboundMovePlayerPos, s_move_player_pos_rot::ServerboundMovePlayerPosRot, s_move_player_rot::ServerboundMovePlayerRot, - s_move_player_status_only::ServerboundMovePlayerStatusOnly, + s_move_player_status_only::ServerboundMovePlayerStatusOnly, s_player_command, }, }, }; @@ -283,9 +283,9 @@ pub fn send_sprinting_if_needed( let was_sprinting = physics_state.was_sprinting; if **sprinting != was_sprinting { let sprinting_action = if **sprinting { - azalea_protocol::packets::game::s_player_command::Action::StartSprinting + s_player_command::Action::StartSprinting } else { - azalea_protocol::packets::game::s_player_command::Action::StopSprinting + s_player_command::Action::StopSprinting }; commands.trigger(SendGamePacketEvent::new( entity, -- cgit v1.2.3