pub fn merged_face_occludes(
shape1: VoxelShape,
shape2: VoxelShape,
direction: Direction,
) -> boolExpand description
Checks if two voxel shapes fully occlude the face between them. Returns true if fluid/objects cannot pass through the face.
Direct equivalent of vanilla’s Shapes.mergedFaceOccludes(shape1, shape2, direction).
The algorithm:
- Fast path: if either shape is a full cube →
true(face fully sealed). - For each shape, keep only the face slice that actually touches the shared face boundary (shapes that don’t reach the boundary contribute nothing).
- Project both slices onto a 16×16 rasterisation grid and check if their union covers all 256 pixels.
Note: vanilla uses exact discrete-voxel arithmetic; the 16×16 rasterisation used here is equivalent for all vanilla block shapes (aligned to 1/16) but may have floating-point rounding for non-standard shapes from future mods.