define origin
This commit is contained in:
parent
68e8717b5c
commit
4c4bce3561
@ -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
|
||||
|
@ -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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user