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 Vec3i origin;
|
||||||
private int ticks;
|
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);
|
File file = new File(new File(Minecraft.getMinecraft().gameDir, "schematics"), schematicFile);
|
||||||
System.out.println(file + " " + file.exists());
|
System.out.println(file + " " + file.exists());
|
||||||
return build(schematicFile, file, ctx.playerFeet());
|
return build(schematicFile, file, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -255,8 +255,19 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (msg.startsWith("build")) {
|
if (msg.startsWith("build")) {
|
||||||
String file = msg.substring(6) + ".schematic";
|
String file;
|
||||||
logDirect("" + baritone.getBuilderProcess().build(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;
|
return true;
|
||||||
}
|
}
|
||||||
if (msg.equals("axis")) {
|
if (msg.equals("axis")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user