aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/position.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-09-17 21:44:17 -0500
committermat <git@matdoes.dev>2023-09-17 21:44:17 -0500
commit856a3252f693421df519cbc4d9bc03cfc0f0c212 (patch)
tree310cffa9d9c09a4651ab1707899ae20416713fc0 /azalea-core/src/position.rs
parent61e63c08968f7b0f451c4c3b07ea8d4927b14a2f (diff)
downloadazalea-drasl-856a3252f693421df519cbc4d9bc03cfc0f0c212.tar.xz
heightmaps
Diffstat (limited to 'azalea-core/src/position.rs')
-rwxr-xr-xazalea-core/src/position.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs
index eb6bcd89..f8072fa4 100755
--- a/azalea-core/src/position.rs
+++ b/azalea-core/src/position.rs
@@ -346,6 +346,17 @@ impl From<Vec3> for ChunkPos {
}
}
+impl From<&Vec3> for ChunkBlockPos {
+ fn from(pos: &Vec3) -> Self {
+ ChunkBlockPos::from(&BlockPos::from(pos))
+ }
+}
+impl From<Vec3> for ChunkBlockPos {
+ fn from(pos: Vec3) -> Self {
+ ChunkBlockPos::from(&pos)
+ }
+}
+
const PACKED_X_LENGTH: u64 = 1 + 25; // minecraft does something a bit more complicated to get this 25
const PACKED_Z_LENGTH: u64 = PACKED_X_LENGTH;
const PACKED_Y_LENGTH: u64 = 64 - PACKED_X_LENGTH - PACKED_Z_LENGTH;