diff options
Diffstat (limited to 'azalea-core/src')
| -rw-r--r-- | azalea-core/src/position.rs | 11 |
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 // ........ |
