diff options
Diffstat (limited to 'azalea-physics/src/collision')
| -rw-r--r-- | azalea-physics/src/collision/mod.rs | 8 | ||||
| -rw-r--r-- | azalea-physics/src/collision/shape.rs | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 2e46970d..ef994deb 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -322,13 +322,9 @@ fn collide_with_shapes( /// /// The instance and position are required so it can check if the block above is /// also the same fluid type. -pub fn fluid_shape( - fluid: &FluidState, - world: &ChunkStorage, - pos: &BlockPos, -) -> &'static VoxelShape { +pub fn fluid_shape(fluid: &FluidState, world: &ChunkStorage, pos: BlockPos) -> &'static VoxelShape { if fluid.amount == 9 { - let fluid_state_above = world.get_fluid_state(&pos.up(1)).unwrap_or_default(); + let fluid_state_above = world.get_fluid_state(pos.up(1)).unwrap_or_default(); if fluid_state_above.kind == fluid.kind { return &BLOCK_SHAPE; } diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs index 59671622..4d430ee7 100644 --- a/azalea-physics/src/collision/shape.rs +++ b/azalea-physics/src/collision/shape.rs @@ -408,7 +408,7 @@ impl VoxelShape { } } - pub fn clip(&self, from: &Vec3, to: &Vec3, block_pos: &BlockPos) -> Option<BlockHitResult> { + pub fn clip(&self, from: &Vec3, to: &Vec3, block_pos: BlockPos) -> Option<BlockHitResult> { if self.is_empty() { return None; } @@ -424,7 +424,7 @@ impl VoxelShape { self.find_index(Axis::Z, right_after_start.z - block_pos.z as f64), ) { Some(BlockHitResult { - block_pos: *block_pos, + block_pos, direction: Direction::nearest(vector).opposite(), location: right_after_start, inside: true, @@ -755,7 +755,7 @@ mod tests { .clip( &Vec3::new(-0.3, 0.5, 0.), &Vec3::new(5.3, 0.5, 0.), - &BlockPos::new(0, 0, 0), + BlockPos::new(0, 0, 0), ) .unwrap(); |
