aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-06-20 06:22:16 +0000
committerGitHub <noreply@github.com>2022-06-20 06:22:16 +0000
commita1484f66290517b6c36f2e82c92613f23d2c4935 (patch)
treef0a590ef6deac0c23c932773354fc4f75903953a /azalea-core/src
parente2553bbaf2a550f4941b924e703a922345a1389f (diff)
parent405a00c0d1908a4b3fbd8e6684c77dfb178ac55d (diff)
downloadazalea-drasl-a1484f66290517b6c36f2e82c92613f23d2c4935.tar.xz
Merge branch 'main' into 1.19.1
Diffstat (limited to 'azalea-core/src')
-rwxr-xr-xazalea-core/src/lib.rs4
-rw-r--r--azalea-core/src/position.rs17
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::*;