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

View File

@ -280,6 +280,7 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
onLostControl();
return null;
}
trim(bcc);
if (baritone.getInputOverrideHandler().isInputForcedDown(Input.CLICK_LEFT)) {
ticks = 5;
} else {
@ -366,6 +367,14 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
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) {
BetterBlockPos center = ctx.playerFeet();
for (int dx = -5; dx <= 5; dx++) {