trim big schematics

This commit is contained in:
Leijurv 2019-02-19 22:50:03 -08:00
parent 3e94d92fbd
commit 963641a818
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 9 additions and 0 deletions

View File

@ -280,6 +280,7 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
onLostControl(); onLostControl();
return null; return null;
} }
trim(bcc);
if (baritone.getInputOverrideHandler().isInputForcedDown(Input.CLICK_LEFT)) { if (baritone.getInputOverrideHandler().isInputForcedDown(Input.CLICK_LEFT)) {
ticks = 5; ticks = 5;
} else { } else {
@ -366,6 +367,14 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
return !incorrectPositions.isEmpty(); return !incorrectPositions.isEmpty();
} }
public void trim(BuilderCalculationContext bcc) {
HashSet<BetterBlockPos> copy = new HashSet<>(incorrectPositions);
copy.removeIf(pos -> pos.distanceSq(ctx.player().posX, ctx.player().posY, ctx.player().posZ) > 200);
if (!copy.isEmpty()) {
incorrectPositions = copy;
}
}
public void recalcNearby(BuilderCalculationContext bcc) { public void recalcNearby(BuilderCalculationContext bcc) {
BetterBlockPos center = ctx.playerFeet(); BetterBlockPos center = ctx.playerFeet();
for (int dx = -5; dx <= 5; dx++) { for (int dx = -5; dx <= 5; dx++) {