aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-core/src')
-rw-r--r--azalea-core/src/aabb.rs6
-rw-r--r--azalea-core/src/position.rs12
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 {