From b0bd992adcff71ee294dd05060e00e652f62a7b2 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 16 Mar 2025 13:41:17 -0500 Subject: Fluid physics fixes (#210) * start fixing code related to fluid physics * implement force_solid for blocks * afk pool test --- azalea-physics/src/collision/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'azalea-physics/src/collision/mod.rs') 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 -- cgit v1.2.3