Skip to content

Commit

Permalink
don't mine outside blockbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 16, 2023
1 parent f2899ff commit 75553b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions azalea/src/pathfinder_extras/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,16 @@ pub fn process_tick(
// the index is from the top-down, so 0 means the top layer
let layer_index = determine_layer(&bb, &chunk_storage);
let layer_bb = BlockBox::new(
BlockPos::new(bb.min().x, bb.max().y - layer_index as i32, bb.min().z),
BlockPos::new(bb.max().x, bb.max().y - layer_index as i32, bb.max().z),
BlockPos::new(
bb.min().x,
i32::max(bb.min().y, bb.max().y - layer_index as i32),
bb.min().z,
),
BlockPos::new(
bb.max().x,
i32::max(bb.min().y, bb.max().y - layer_index as i32),
bb.max().z,
),
);

let reachable_blocks =
Expand Down

0 comments on commit 75553b9

Please sign in to comment.