diff options
| author | mat <git@matdoes.dev> | 2024-12-23 01:31:17 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-12-23 01:31:17 +0000 |
| commit | a477a84c6ef4b20929cbdffa697686fcbc20225e (patch) | |
| tree | e0cd60b98fbbfc1187e929c7fdc82b27c30f18fa /azalea-physics | |
| parent | 3b1fe490b01258b370d58e70c71945f522010639 (diff) | |
| download | azalea-drasl-a477a84c6ef4b20929cbdffa697686fcbc20225e.tar.xz | |
exit get_block_state early if below the world
Diffstat (limited to 'azalea-physics')
| -rw-r--r-- | azalea-physics/src/collision/world_collisions.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 991721b2..237dd127 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -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); |
