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-core/src | |
| parent | d27d283686d2920d7a7c08087e2d5a39c63fae1c (diff) | |
| download | azalea-drasl-0a945e73ec43b3b0389e004e138c83f41cddc532.tar.xz | |
EntityPos
Diffstat (limited to 'azalea-core/src')
| -rwxr-xr-x | azalea-core/src/lib.rs | 4 | ||||
| -rw-r--r-- | azalea-core/src/position.rs | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index cdb32ea9..a2632871 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -11,9 +11,7 @@ mod slot; pub use slot::{Slot, SlotData}; mod position; -pub use position::{ - BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos, GlobalPos, -}; +pub use position::*; mod direction; pub use direction::Direction; diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index d5c97eab..24be5f6a 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -147,6 +147,23 @@ pub struct GlobalPos { pub dimension: ResourceLocation, } +#[derive(Debug, Clone, Default)] +pub struct EntityPos { + pub x: f64, + pub y: f64, + pub z: f64, +} + +impl From<&EntityPos> for BlockPos { + fn from(pos: &EntityPos) -> Self { + BlockPos { + x: pos.x as i32, + y: pos.y as i32, + z: pos.z as i32, + } + } +} + #[cfg(test)] mod tests { use super::*; |
