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
This commit is contained in:
ice_iix 2019-05-11 14:53:42 -07:00
parent 0034756339
commit a081c73215
2 changed files with 9 additions and 1 deletions

View File

@ -1310,6 +1310,14 @@ state_packets!(
field pitch: f32 =,
field flags: u8 =,
}
packet TeleportPlayer_OnGround {
field x: f64 =,
field eyes_y: f64 =,
field z: f64 =,
field yaw: f32 =,
field pitch: f32 =,
field on_ground: bool =,
}
/// EntityUsedBed is sent by the server when a player goes to bed.
packet EntityUsedBed {
field entity_id: VarInt =,

View File

@ -42,7 +42,7 @@ protocol_packet_ids!(
0x05 => SpawnPosition_i32
0x06 => UpdateHealth_u16
0x07 => Respawn
0x08 => TeleportPlayer_NoConfirm
0x08 => TeleportPlayer_OnGround
0x09 => SetCurrentHotbarSlot
0x0a => EntityUsedBed_i32
0x0b => Animation