Skip to content

Commit 5e0f917

Browse files
committed
1.7.10: Fix player position too high on login. Closes #87
Adds a new TeleportPlayer_NoGround packet, which is subtly different from TeleportPlayer_NoConfirm. The flags u8 is replaced with an on_ground bool, but more importantly the Y position is the eyes position, so we have to translate to feet position for the client. 1.7.10: https://wiki.vg/index.php?title=Protocol&oldid=6003#Player_Position_And_Look 1.8.9: https://wiki.vg/index.php?title=Protocol&oldid=7368#Player_Position_And_Look
1 parent 72dbf80 commit 5e0f917

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

protocol/src/packet.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,14 @@ state_packets!(
13101310
field pitch: f32 =,
13111311
field flags: u8 =,
13121312
}
1313+
packet TeleportPlayer_OnGround {
1314+
field x: f64 =,
1315+
field eyes_y: f64 =,
1316+
field z: f64 =,
1317+
field yaw: f32 =,
1318+
field pitch: f32 =,
1319+
field on_ground: bool =,
1320+
}
13131321
/// EntityUsedBed is sent by the server when a player goes to bed.
13141322
packet EntityUsedBed {
13151323
field entity_id: VarInt =,

protocol/src/versions/v1_7_10.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protocol_packet_ids!(
4242
0x05 => SpawnPosition_i32
4343
0x06 => UpdateHealth_u16
4444
0x07 => Respawn
45-
0x08 => TeleportPlayer_NoConfirm
45+
0x08 => TeleportPlayer_OnGround
4646
0x09 => SetCurrentHotbarSlot
4747
0x0a => EntityUsedBed_i32
4848
0x0b => Animation

0 commit comments

Comments
 (0)