diff options
| author | mat <github@matdoes.dev> | 2022-06-23 15:12:17 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-23 15:12:17 -0500 |
| commit | 5ca49e680ed8519456dc9a9af84321d4b69dcbb3 (patch) | |
| tree | 0f727c3e862f60eb227db69c87946a0f629a397d /azalea-entity/src/lib.rs | |
| parent | c7b0c51274b5d8548c8a2f829b75dfbec4038be2 (diff) | |
| download | azalea-drasl-5ca49e680ed8519456dc9a9af84321d4b69dcbb3.tar.xz | |
azalea-buf
Diffstat (limited to 'azalea-entity/src/lib.rs')
| -rw-r--r-- | azalea-entity/src/lib.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index d32a1a96..2283142f 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -1,6 +1,11 @@ +mod data; + use azalea_core::EntityPos; #[cfg(feature = "protocol")] -use azalea_protocol::packets::game::clientbound_add_entity_packet::ClientboundAddEntityPacket; +use azalea_protocol::packets::game::{ + clientbound_add_entity_packet::ClientboundAddEntityPacket, + clientbound_add_player_packet::ClientboundAddPlayerPacket, +}; use uuid::Uuid; #[derive(Default, Debug)] @@ -38,6 +43,21 @@ impl From<&ClientboundAddEntityPacket> for Entity { } } +#[cfg(feature = "protocol")] +impl From<&ClientboundAddPlayerPacket> for Entity { + fn from(p: &ClientboundAddPlayerPacket) -> Self { + Self { + id: p.id, + uuid: p.uuid, + pos: EntityPos { + x: p.x, + y: p.y, + z: p.z, + }, + } + } +} + // #[cfg(test)] // mod tests { // #[test] |
