1.15.1+: handle SpawnPlayer variant, fixes #357

This commit is contained in:
ice_iix 2020-07-05 00:21:26 -07:00
parent 1fabc0c5bf
commit d362f136f1
1 changed files with 16 additions and 0 deletions

View File

@ -550,6 +550,7 @@ impl Server {
// Entities
EntityDestroy => on_entity_destroy,
EntityDestroy_u8 => on_entity_destroy_u8,
SpawnPlayer_f64_NoMeta => on_player_spawn_f64_nometa,
SpawnPlayer_f64 => on_player_spawn_f64,
SpawnPlayer_i32 => on_player_spawn_i32,
SpawnPlayer_i32_HeldItem => on_player_spawn_i32_helditem,
@ -1322,6 +1323,21 @@ impl Server {
}
}
fn on_player_spawn_f64_nometa(
&mut self,
spawn: packet::play::clientbound::SpawnPlayer_f64_NoMeta,
) {
self.on_player_spawn(
spawn.entity_id.0,
spawn.uuid,
spawn.x,
spawn.y,
spawn.z,
spawn.yaw as f64,
spawn.pitch as f64,
)
}
fn on_player_spawn_f64(&mut self, spawn: packet::play::clientbound::SpawnPlayer_f64) {
self.on_player_spawn(
spawn.entity_id.0,