diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-06-08 23:37:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-08 23:37:54 +0000 |
| commit | 601637bd48fcba826da01725430268f706181449 (patch) | |
| tree | 5b58723b931450d358d7e4387d87cc8e8b9166b2 /azalea-core/src | |
| parent | ea7249fb77a8e07d232600081c9c3df5f698d70f (diff) | |
| parent | fb1d419a3d4207a293a1ad6001253192f1b4d12f (diff) | |
| download | azalea-drasl-601637bd48fcba826da01725430268f706181449.tar.xz | |
Merge pull request #7 from mat-1/1.19
1.19
Diffstat (limited to 'azalea-core/src')
| -rwxr-xr-x | azalea-core/src/lib.rs | 4 | ||||
| -rw-r--r-- | azalea-core/src/position.rs | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index d2a2d558..cdb32ea9 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -11,7 +11,9 @@ mod slot; pub use slot::{Slot, SlotData}; mod position; -pub use position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}; +pub use position::{ + BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos, GlobalPos, +}; mod direction; pub use direction::Direction; diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 9c7cd132..d5c97eab 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -1,5 +1,7 @@ use std::ops::Rem; +use crate::resource_location::ResourceLocation; + #[derive(Clone, Copy, Debug, Default)] pub struct BlockPos { pub x: i32, @@ -137,6 +139,14 @@ impl From<&ChunkBlockPos> for ChunkSectionBlockPos { } } +/// A block pos with an attached dimension +#[derive(Debug, Clone)] +pub struct GlobalPos { + pub pos: BlockPos, + // this is actually a ResourceKey in Minecraft, but i don't think it matters? + pub dimension: ResourceLocation, +} + #[cfg(test)] mod tests { use super::*; |
