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.
This commit is contained in:
@@ -717,13 +717,16 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
List<BetterBlockPos> sourceLiquids = new ArrayList<>();
|
||||
List<BetterBlockPos> flowingLiquids = new ArrayList<>();
|
||||
Map<BlockState, Integer> missing = new HashMap<>();
|
||||
List<BetterBlockPos> 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 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
}
|
||||
}
|
||||
});
|
||||
incorrectPositions.removeAll(outOfBounds);
|
||||
List<Goal> toBreak = new ArrayList<>();
|
||||
breakable.forEach(pos -> toBreak.add(breakGoal(pos, bcc)));
|
||||
List<Goal> toPlace = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user