diff options
| author | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
| commit | 9b0bd29db4faa9d94df0cec472346b814e7efcb9 (patch) | |
| tree | 4f681b5143eb5ebe69a0b5b53125ea7509f8026a /azalea-core | |
| parent | 2a6ac0764fe9975f9b16d495ce773e4ae1f097e0 (diff) | |
| download | azalea-drasl-9b0bd29db4faa9d94df0cec472346b814e7efcb9.tar.xz | |
take BlockPos instead of &BlockPos in all function arguments
Diffstat (limited to 'azalea-core')
| -rw-r--r-- | azalea-core/src/aabb.rs | 6 | ||||
| -rw-r--r-- | azalea-core/src/position.rs | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/azalea-core/src/aabb.rs b/azalea-core/src/aabb.rs index 42ae797d..03a754f0 100644 --- a/azalea-core/src/aabb.rs +++ b/azalea-core/src/aabb.rs @@ -211,7 +211,7 @@ impl AABB { boxes: &Vec<AABB>, from: &Vec3, to: &Vec3, - pos: &BlockPos, + pos: BlockPos, ) -> Option<BlockHitResult> { let mut t = 1.0; let mut dir = None; @@ -230,7 +230,7 @@ impl AABB { Some(BlockHitResult { location: from + &(delta * t), direction: dir, - block_pos: *pos, + block_pos: pos, inside: false, miss: false, world_border: false, @@ -500,7 +500,7 @@ mod tests { }], &Vec3::new(-1., -1., -1.), &Vec3::new(1., 1., 1.), - &BlockPos::new(0, 0, 0), + BlockPos::new(0, 0, 0), ), None ); diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 7cb8b143..b1560577 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -589,6 +589,12 @@ impl From<&ChunkBiomePos> for ChunkSectionBiomePos { } } } +impl From<ChunkBiomePos> for ChunkSectionBiomePos { + #[inline] + fn from(pos: ChunkBiomePos) -> Self { + Self::from(&pos) + } +} vec3_impl!(ChunkSectionBiomePos, u8); /// The coordinates of a biome inside a chunk. Biomes are 4x4 blocks. @@ -604,6 +610,12 @@ impl From<&BlockPos> for ChunkBiomePos { ChunkBiomePos::from(&ChunkBlockPos::from(pos)) } } +impl From<BlockPos> for ChunkBiomePos { + #[inline] + fn from(pos: BlockPos) -> Self { + ChunkBiomePos::from(&ChunkBlockPos::from(pos)) + } +} impl From<&ChunkBlockPos> for ChunkBiomePos { #[inline] fn from(pos: &ChunkBlockPos) -> Self { |
