diff options
| author | mat <github@matdoes.dev> | 2022-06-17 18:09:34 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-17 18:09:34 -0500 |
| commit | 0a945e73ec43b3b0389e004e138c83f41cddc532 (patch) | |
| tree | ef28483d3b147946b546d8e897ef91acbec2d51b /azalea-client/src | |
| parent | d27d283686d2920d7a7c08087e2d5a39c63fae1c (diff) | |
| download | azalea-drasl-0a945e73ec43b3b0389e004e138c83f41cddc532.tar.xz | |
EntityPos
Diffstat (limited to 'azalea-client/src')
| -rwxr-xr-x | azalea-client/src/connect.rs | 7 | ||||
| -rw-r--r-- | azalea-client/src/entity.rs | 5 | ||||
| -rw-r--r-- | azalea-client/src/player.rs | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index 4ef3df63..1551ca69 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -1,5 +1,5 @@ use crate::Player; -use azalea_core::{resource_location::ResourceLocation, ChunkPos}; +use azalea_core::{resource_location::ResourceLocation, ChunkPos, EntityPos}; use azalea_protocol::{ connect::{GameConnection, HandshakeConnection}, packets::{ @@ -351,6 +351,11 @@ impl Client { } GamePacket::ClientboundAddEntityPacket(p) => { println!("Got add entity packet {:?}", p); + let pos = EntityPos { + x: p.x, + y: p.y, + z: p.z, + }; } GamePacket::ClientboundSetEntityDataPacket(p) => { // println!("Got set entity data packet {:?}", p); diff --git a/azalea-client/src/entity.rs b/azalea-client/src/entity.rs index ed8aa68d..d91f556f 100644 --- a/azalea-client/src/entity.rs +++ b/azalea-client/src/entity.rs @@ -1,5 +1,8 @@ -#[derive(Default)] +use azalea_core::EntityPos; + +#[derive(Default, Debug)] pub struct Entity { /// The incremental numerical id of the entity. pub id: u32, + pub pos: EntityPos, } diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs index fc54ff93..04d34f6d 100644 --- a/azalea-client/src/player.rs +++ b/azalea-client/src/player.rs @@ -1,6 +1,6 @@ use crate::Entity; -#[derive(Default)] +#[derive(Default, Debug)] pub struct Player { /// The entity attached to the player. There's some useful fields here. pub entity: Entity, |
