Skip to content

Commit a159355

Browse files
committed
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
1 parent c8e13c3 commit a159355

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ impl Server {
551551
} else {
552552
let packet = packet::play::serverbound::PlayerPositionLook_HeadY {
553553
x: position.position.x,
554-
feet_y: position.position.y - 1.62,
555-
head_y: position.position.y,
554+
feet_y: position.position.y,
555+
head_y: position.position.y + 1.62,
556556
z: position.position.z,
557557
yaw: -(rotation.yaw as f32) * (180.0 / PI),
558558
pitch: (-rotation.pitch as f32) * (180.0 / PI) + 180.0,

0 commit comments

Comments
 (0)