From 37c6618c16319a7f40fd2e165190407472598e84 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 23 Jun 2022 19:17:04 -0500 Subject: Fix everything so azalea-buf works --- .../src/packets/game/clientbound_add_entity_packet.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs') diff --git a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs index 9ef7e05c..0fc7b817 100644 --- a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs @@ -1,4 +1,7 @@ -use packet_macros::{GamePacket, McBuf}; +use azalea_buf::McBuf; +use azalea_core::EntityPos; +use azalea_entity::Entity; +use packet_macros::GamePacket; use uuid::Uuid; #[derive(Clone, Debug, McBuf, GamePacket)] @@ -22,3 +25,17 @@ pub struct ClientboundAddEntityPacket { pub y_vel: i16, pub z_vel: i16, } + +impl From<&ClientboundAddEntityPacket> for Entity { + fn from(p: &ClientboundAddEntityPacket) -> Self { + Self::new( + p.id, + p.uuid, + EntityPos { + x: p.x, + y: p.y, + z: p.z, + }, + ) + } +} -- cgit v1.2.3