Skip to content

Commit

Permalink
exit get_block_state early if below the world
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 23, 2024
1 parent 3b1fe49 commit a477a84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions azalea-physics/src/collision/world_collisions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ impl<'a> BlockCollisionsState<'a> {
}

fn get_block_state(&mut self, block_pos: BlockPos) -> BlockState {
if block_pos.y < self.world.chunks.min_y {
// below the world
return BlockState::AIR;
}

let section_pos = ChunkSectionPos::from(block_pos);
let section_block_pos = ChunkSectionBlockPos::from(block_pos);

Expand Down

0 comments on commit a477a84

Please sign in to comment.