aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src/collision/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-physics/src/collision/mod.rs')
-rw-r--r--azalea-physics/src/collision/mod.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs
index 540cf7d4..77af1232 100644
--- a/azalea-physics/src/collision/mod.rs
+++ b/azalea-physics/src/collision/mod.rs
@@ -1,8 +1,9 @@
mod blocks;
mod discrete_voxel_shape;
+pub mod entity_collisions;
mod mergers;
mod shape;
-mod world_collisions;
+pub mod world_collisions;
use std::{ops::Add, sync::LazyLock};
@@ -279,7 +280,7 @@ fn collide_bounding_box(
// TODO: world border
let block_collisions =
- get_block_collisions(world, entity_bounding_box.expand_towards(movement));
+ get_block_collisions(world, &entity_bounding_box.expand_towards(movement));
collision_boxes.extend(block_collisions);
collide_with_shapes(movement, *entity_bounding_box, &collision_boxes)
}
@@ -392,6 +393,11 @@ fn calculate_shape_for_fluid(amount: u8) -> VoxelShape {
///
/// This is marked as deprecated in Minecraft.
pub fn legacy_blocks_motion(block: BlockState) -> bool {
+ if block == BlockState::AIR {
+ // fast path
+ return false;
+ }
+
let registry_block = azalea_registry::Block::from(block);
legacy_calculate_solid(block)
&& registry_block != azalea_registry::Block::Cobweb