aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/movement.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-06-26 12:32:01 +0930
committermat <git@matdoes.dev>2025-06-26 10:05:58 +0700
commitf9e4b65713bbacabcd54416a388a92b90f56ab47 (patch)
tree25d392d60836351311e9f498d40277c226c1e32c /azalea-client/src/plugins/movement.rs
parentaf1ef9310093aa3c8dfd5054eb6d0b8c7c0d0b31 (diff)
downloadazalea-drasl-f9e4b65713bbacabcd54416a388a92b90f56ab47.tar.xz
start adding packet_order test
Diffstat (limited to 'azalea-client/src/plugins/movement.rs')
-rw-r--r--azalea-client/src/plugins/movement.rs36
1 files changed, 19 insertions, 17 deletions
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index b4649f20..5d43261f 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -6,14 +6,17 @@ use azalea_entity::{
metadata::Sprinting,
};
use azalea_physics::{PhysicsSet, ai_step};
-use azalea_protocol::packets::{
- Packet,
- game::{
- ServerboundPlayerCommand, ServerboundPlayerInput,
- s_move_player_pos::ServerboundMovePlayerPos,
- s_move_player_pos_rot::ServerboundMovePlayerPosRot,
- s_move_player_rot::ServerboundMovePlayerRot,
- s_move_player_status_only::ServerboundMovePlayerStatusOnly,
+use azalea_protocol::{
+ common::movements::MoveFlags,
+ packets::{
+ Packet,
+ game::{
+ ServerboundPlayerCommand, ServerboundPlayerInput,
+ s_move_player_pos::ServerboundMovePlayerPos,
+ s_move_player_pos_rot::ServerboundMovePlayerPosRot,
+ s_move_player_rot::ServerboundMovePlayerRot,
+ s_move_player_status_only::ServerboundMovePlayerStatusOnly,
+ },
},
};
use azalea_world::{MinecraftEntityId, MoveEntityError};
@@ -186,12 +189,16 @@ pub fn send_position(
// if self.is_passenger() {
// TODO: posrot packet for being a passenger
// }
+ let flags = MoveFlags {
+ on_ground: physics.on_ground(),
+ horizontal_collision: physics.horizontal_collision,
+ };
let packet = if sending_position && sending_direction {
Some(
ServerboundMovePlayerPosRot {
pos: **position,
look_direction: *direction,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
@@ -199,7 +206,7 @@ pub fn send_position(
Some(
ServerboundMovePlayerPos {
pos: **position,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
@@ -207,17 +214,12 @@ pub fn send_position(
Some(
ServerboundMovePlayerRot {
look_direction: *direction,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
} else if physics.last_on_ground() != physics.on_ground() {
- Some(
- ServerboundMovePlayerStatusOnly {
- on_ground: physics.on_ground(),
- }
- .into_variant(),
- )
+ Some(ServerboundMovePlayerStatusOnly { flags }.into_variant())
} else {
None
};