diff --git a/src/kagami/callbacks/manager.rs b/src/kagami/callbacks/manager.rs index 938516f..deac49e 100644 --- a/src/kagami/callbacks/manager.rs +++ b/src/kagami/callbacks/manager.rs @@ -105,6 +105,7 @@ impl CallbackManager { Packets::ServerKeepAlive(p) => p.handle_callbacks(&self.callbacks), Packets::ServerChat(p) => p.handle_callbacks(&self.callbacks), Packets::UpdateTime(p) => p.handle_callbacks(&self.callbacks), + Packets::SpawnPosition(p) => p.handle_callbacks(&self.callbacks), Packets::UpdateHealth(p) => p.handle_callbacks(&self.callbacks), Packets::Login(p) => p.handle_callbacks(&self.callbacks), Packets::Respawn(p) => p.handle_callbacks(&self.callbacks), diff --git a/src/kagami/callbacks/type_id_map.rs b/src/kagami/callbacks/type_id_map.rs index bf858b4..23eb1f4 100644 --- a/src/kagami/callbacks/type_id_map.rs +++ b/src/kagami/callbacks/type_id_map.rs @@ -85,7 +85,7 @@ impl TypeIdMap { self.gen::(0x02, Play, Server); self.gen::(0x03, Play, Server); // self.gen::(0x04, Play, Server); - // self.gen::(0x05, Play, Server); + self.gen::(0x05, Play, Server); self.gen::(0x06, Play, Server); self.gen::(0x07, Play, Server); self.gen::(0x08, Play, Server); diff --git a/src/minecraft/mod.rs b/src/minecraft/mod.rs index 3662122..4b98836 100644 --- a/src/minecraft/mod.rs +++ b/src/minecraft/mod.rs @@ -101,6 +101,7 @@ pub enum Packets { ServerKeepAlive(packets::play::server::KeepAlive), Login(packets::play::server::Login), UpdateTime(packets::play::server::UpdateTime), + SpawnPosition(packets::play::server::SpawnPosition), UpdateHealth(packets::play::server::UpdateHealth), Respawn(packets::play::server::Respawn), ServerPosition(packets::play::server::Position), diff --git a/src/minecraft/packets/play/server.rs b/src/minecraft/packets/play/server.rs index fc8b688..f54ecff 100644 --- a/src/minecraft/packets/play/server.rs +++ b/src/minecraft/packets/play/server.rs @@ -25,6 +25,7 @@ mod position; mod respawn; mod spawn_entity_experience_orb; mod spawn_entity_painting; +mod spawn_position; mod update_health; mod update_time; @@ -52,6 +53,7 @@ pub use position::Position; pub use respawn::Respawn; pub use spawn_entity_experience_orb::SpawnEntityExperienceOrb; pub use spawn_entity_painting::SpawnEntityPainting; +pub use spawn_position::SpawnPosition; pub use update_health::UpdateHealth; pub use update_time::UpdateTime; @@ -68,10 +70,9 @@ pub fn parse_packet(packet_id: i32, bytes: &[u8]) -> Result { // 0x04 => Ok(Packets::EntityEquipment(EntityEquipment::deserialize_packet( // bytes, // )?)), - - // 0x05 => Ok(Packets::SpawnPosition(SpawnPosition::deserialize_packet( - // bytes, - // )?)), + 0x05 => Ok(Packets::SpawnPosition(SpawnPosition::deserialize_packet( + bytes, + )?)), 0x06 => Ok(Packets::UpdateHealth(UpdateHealth::deserialize_packet( bytes, )?)), diff --git a/src/minecraft/packets/play/server/spawn_position.rs b/src/minecraft/packets/play/server/spawn_position.rs new file mode 100644 index 0000000..9e688bd --- /dev/null +++ b/src/minecraft/packets/play/server/spawn_position.rs @@ -0,0 +1,8 @@ +use crate::minecraft::Packet; +use crate::serialization::Position; +use kagami_macro::{packet, Deserialize, Packet, Serialize}; + +#[packet] +pub struct SpawnPosition { + position: Position, +}