aboutsummaryrefslogtreecommitdiff
path: root/azalea-core
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-06-02 15:55:39 -0300
committermat <git@matdoes.dev>2025-06-02 15:55:39 -0300
commitcee64cece3ddbe4c0a41f0761d69b7c490d85040 (patch)
treef66b4fa3aea2ed3f681a9fe0b2c0cef800389fc2 /azalea-core
parentc5ddae58a172289fffde991830bb79860421a961 (diff)
downloadazalea-drasl-cee64cece3ddbe4c0a41f0761d69b7c490d85040.tar.xz
actually send Event::ReceiveChunk
Diffstat (limited to 'azalea-core')
-rw-r--r--azalea-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 5932cb5b..357e9b39 100644
--- a/azalea-core/src/position.rs
+++ b/azalea-core/src/position.rs
@@ -444,6 +444,17 @@ impl Add<ChunkPos> for ChunkPos {
}
}
}
+impl Add<ChunkBlockPos> for ChunkPos {
+ type Output = BlockPos;
+
+ fn add(self, rhs: ChunkBlockPos) -> Self::Output {
+ BlockPos {
+ x: self.x * 16 + rhs.x as i32,
+ y: rhs.y,
+ z: self.z * 16 + rhs.z as i32,
+ }
+ }
+}
// reading ChunkPos is done in reverse, so z first and then x
// ........