From e9136c9cbbf9010b8352127e129c1cd290f377bd Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:51:12 -0600 Subject: Implement EntityPositionSync (#196) * implement EntityPositionSync * fix EntityPositionSync setting the wrong vec_delta_codec and also move into a RelativeEntityUpdate --- azalea-client/src/movement.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'azalea-client/src/movement.rs') diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index 03183e24..bdc29f2f 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -195,7 +195,7 @@ pub fn send_position( pos: **position, x_rot: direction.x_rot, y_rot: direction.y_rot, - on_ground: physics.on_ground, + on_ground: physics.on_ground(), } .into_variant(), ) @@ -205,7 +205,7 @@ pub fn send_position( x: position.x, y: position.y, z: position.z, - on_ground: physics.on_ground, + on_ground: physics.on_ground(), } .into_variant(), ) @@ -214,14 +214,14 @@ pub fn send_position( ServerboundMovePlayerRot { x_rot: direction.x_rot, y_rot: direction.y_rot, - on_ground: physics.on_ground, + on_ground: physics.on_ground(), } .into_variant(), ) - } else if physics.last_on_ground != physics.on_ground { + } else if physics.last_on_ground() != physics.on_ground() { Some( ServerboundMovePlayerStatusOnly { - on_ground: physics.on_ground, + on_ground: physics.on_ground(), } .into_variant(), ) @@ -238,7 +238,8 @@ pub fn send_position( last_direction.x_rot = direction.x_rot; } - physics.last_on_ground = physics.on_ground; + let on_ground = physics.on_ground(); + physics.set_last_on_ground(on_ground); // minecraft checks for autojump here, but also autojump is bad so packet -- cgit v1.2.3