From c25b1325daa76d46ebb4262b7dfeb6ff6e8f9eb5 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:34:17 +0200 Subject: [PATCH] Handle positions going out of bounds between ticks They also have to be removed rather than ignored because they won't be scanned again and would stay in `incorrectPositions` indefinitely. --- src/main/java/baritone/process/BuilderProcess.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index cb6eb9d8a..ff1ec6d13 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -717,13 +717,16 @@ private Goal assemble(BuilderCalculationContext bcc, List approxPlac List sourceLiquids = new ArrayList<>(); List flowingLiquids = new ArrayList<>(); Map missing = new HashMap<>(); + List outOfBounds = new ArrayList<>(); incorrectPositions.forEach(pos -> { BlockState state = bcc.bsi.get0(pos); if (state.getBlock() instanceof AirBlock) { - if (containsBlockState(approxPlaceable, bcc.getSchematic(pos.x, pos.y, pos.z, state))) { + BlockState desired = bcc.getSchematic(pos.x, pos.y, pos.z, state); + if (desired == null) { + outOfBounds.add(pos); + } else if (containsBlockState(approxPlaceable, desired)) { placeable.add(pos); } else { - BlockState desired = bcc.getSchematic(pos.x, pos.y, pos.z, state); missing.put(desired, 1 + missing.getOrDefault(desired, 0)); } } else { @@ -741,6 +744,7 @@ private Goal assemble(BuilderCalculationContext bcc, List approxPlac } } }); + incorrectPositions.removeAll(outOfBounds); List toBreak = new ArrayList<>(); breakable.forEach(pos -> toBreak.add(breakGoal(pos, bcc))); List toPlace = new ArrayList<>();