From a1593557518f7b69195fed2f5e8a53daa05db955 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sat, 11 May 2019 14:24:41 -0700 Subject: [PATCH] 1.7.10: Fix sending head/feet player position, #87 1.8+ removes the player head position, and sends only the feet position. We store the feet position internally in the client, so the head position has to be calculated, normally 1.62 units higher. Previously the calculation was reversed, which caused the client to show its position as 1.62 units higher than the server, and the server would correct the position when the client descends to the ground. 1.7.10: https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position 1.8.9: https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Position --- src/server/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 5867ab0..f6f8cf2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -551,8 +551,8 @@ impl Server { } else { let packet = packet::play::serverbound::PlayerPositionLook_HeadY { x: position.position.x, - feet_y: position.position.y - 1.62, - head_y: position.position.y, + feet_y: position.position.y, + head_y: position.position.y + 1.62, z: position.position.z, yaw: -(rotation.yaw as f32) * (180.0 / PI), pitch: (-rotation.pitch as f32) * (180.0 / PI) + 180.0,