server: handle TeleportPlayer_WithDismount, fixes world loading

This commit is contained in:
ice_iix 2021-09-05 11:50:27 -07:00
parent fbd4aba971
commit c121f7a9ac
1 changed files with 16 additions and 0 deletions

View File

@ -612,6 +612,7 @@ impl Server {
MultiBlockChange_Packed => on_multi_block_change_packed,
MultiBlockChange_VarInt => on_multi_block_change_varint,
MultiBlockChange_u16 => on_multi_block_change_u16,
TeleportPlayer_WithDismount => on_teleport_player_withdismount,
TeleportPlayer_WithConfirm => on_teleport_player_withconfirm,
TeleportPlayer_NoConfirm => on_teleport_player_noconfirm,
TeleportPlayer_OnGround => on_teleport_player_onground,
@ -1553,6 +1554,21 @@ impl Server {
self.entity_map.insert(entity_id, entity);
}
fn on_teleport_player_withdismount(
&mut self,
teleport: packet::play::clientbound::TeleportPlayer_WithDismount,
) {
self.on_teleport_player(
teleport.x,
teleport.y,
teleport.z,
teleport.yaw as f64,
teleport.pitch as f64,
teleport.flags,
Some(teleport.teleport_id),
)
}
fn on_teleport_player_withconfirm(
&mut self,
teleport: packet::play::clientbound::TeleportPlayer_WithConfirm,