define origin

This commit is contained in:
Leijurv 2019-02-06 22:10:52 -08:00
parent 68e8717b5c
commit 4c4bce3561
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 15 additions and 4 deletions

View File

@ -65,10 +65,10 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
private Vec3i origin;
private int ticks;
public boolean build(String schematicFile) {
public boolean build(String schematicFile, BlockPos origin) {
File file = new File(new File(Minecraft.getMinecraft().gameDir, "schematics"), schematicFile);
System.out.println(file + " " + file.exists());
return build(schematicFile, file, ctx.playerFeet());
return build(schematicFile, file, origin);
}
@Override

View File

@ -255,8 +255,19 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
return true;
}
if (msg.startsWith("build")) {
String file = msg.substring(6) + ".schematic";
logDirect("" + baritone.getBuilderProcess().build(file));
String file;
BlockPos origin;
try {
String[] coords = msg.substring("build".length()).split(" ");
file = coords[0] + ".schematic";
origin = new BlockPos(Integer.parseInt(coords[1]), Integer.parseInt(coords[2]), Integer.parseInt(coords[3]));
} catch (Exception ex) {
file = msg.substring(5) + ".schematic";
origin = ctx.playerFeet();
}
logDirect("Loading '" + file + "' to build from origin " + origin);
boolean success = baritone.getBuilderProcess().build(file, origin);
logDirect(success ? "Loaded" : "Unable to load");
return true;
}
if (msg.equals("axis")) {