/// Returns the up to six adjacent blocks to a given block position.
Returns the up to six adjacent blocks to a given block position.
Returns the up to six adjacent blocks to a given block position .
fn adjacent_blocks(to: BlockPosition) -> ArrayVec<[BlockPosition; 6]> {
    let offsets = [
        (-1, 0, 0),
        (1, 0, 0),
        (0, -1, 0),
        (0, 1, 0),
        (0, 0, -1),
        (0, 0, 1),
    ];
    offsets
        .iter()
        .map(|(x, y, z)| BlockPosition::new(to.x + *x, to.y + *y, to.z + *z))
        .filter(|pos| pos.y >= 0 && pos.y <= 256)
        .collect()
}
fn adjacent_blocks ( to : BlockPosition ) -> ArrayVec < [ BlockPosition ; 6 ] > { let offsets = [ ( - 1 , 0 , 0 ) , ( 1 , 0 , 0 ) , ( 0 , - 1 , 0 ) , ( 0 , 1 , 0 ) , ( 0 , 0 , - 1 ) , ( 0 , 0 , 1 ) , ] ; offsets . iter ( ) . map ( | ( x , y , z ) | BlockPosition :: new ( to . x + * x , to . y + * y , to . z + * z ) ) . filter ( | pos | pos . y >= 0 && pos . y <= 256 ) . collect ( ) }
Returns the up to six adjacent blocks to a given block position.
Returns the up to six adjacent blocks to a given block position .
to
BlockPosition