From cccd61e050cee1b16da01e54c2740a184c581529 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 15 Sep 2019 11:37:09 -0700 Subject: [PATCH] add ability to build from opposite corner --- src/api/java/baritone/api/Settings.java | 15 +++++++++++++++ .../java/baritone/process/BuilderProcess.java | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 614f2340..55420e38 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -742,6 +742,21 @@ public final class Settings { */ public final Setting breakCorrectBlockPenaltyMultiplier = new Setting<>(10d); + /** + * When this setting is true, build a schematic with the highest X coordinate being the origin, instead of the lowest + */ + public final Setting schematicOrientationX = new Setting<>(false); + + /** + * When this setting is true, build a schematic with the highest Y coordinate being the origin, instead of the lowest + */ + public final Setting schematicOrientationY = new Setting<>(false); + + /** + * When this setting is true, build a schematic with the highest Z coordinate being the origin, instead of the lowest + */ + public final Setting schematicOrientationZ = new Setting<>(false); + /** * While mining, should it also consider dropped items of the correct type as a pathing destination (as well as ore blocks)? */ diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index 84ea8da3..b924347c 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -78,7 +78,19 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil this.name = name; this.schematic = schematic; this.realSchematic = null; - this.origin = origin; + int x = origin.getX(); + int y = origin.getY(); + int z = origin.getZ(); + if (Baritone.settings().schematicOrientationX.value) { + x += schematic.widthX(); + } + if (Baritone.settings().schematicOrientationY.value) { + y += schematic.heightY(); + } + if (Baritone.settings().schematicOrientationZ.value) { + z += schematic.lengthZ(); + } + this.origin = new Vec3i(x, y, z); this.paused = false; this.layer = 0; this.observedCompleted = new LongOpenHashSet();