diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-06-17 23:10:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-17 23:10:54 +0000 |
| commit | f414aa4d37e0c6a7adf55b772fa93714be6e9c9c (patch) | |
| tree | 8cfb7d33114b9537b50477d5d6980995eec6cc5c /azalea-core/src | |
| parent | 56f98c1b243d1ba8906ac73a2f2d8eec5646183e (diff) | |
| parent | 0a945e73ec43b3b0389e004e138c83f41cddc532 (diff) | |
| download | azalea-drasl-f414aa4d37e0c6a7adf55b772fa93714be6e9c9c.tar.xz | |
Merge pull request #9 from mat-1/azalea-block
azalea-block
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::*; |
