This commit is contained in:
Leijurv 2018-12-27 08:06:10 -10:00
parent 251110c4f8
commit c45cbebcce
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 7 additions and 3 deletions

View File

@ -41,6 +41,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.Vec3i;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
@ -60,9 +61,11 @@ public class BuilderProcess extends BaritoneProcessHelper {
public boolean build(String schematicFile) {
File file = new File(new File(Minecraft.getMinecraft().gameDir, "schematics"), schematicFile);
System.out.println(file + " " + file.exists());
NBTTagCompound tag;
try {
tag = CompressedStreamTools.read(file);
try (FileInputStream fileIn = new FileInputStream(file)) {
tag = CompressedStreamTools.readCompressed(fileIn);
} catch (IOException e) {
e.printStackTrace();
return false;
@ -107,6 +110,7 @@ public class BuilderProcess extends BaritoneProcessHelper {
// it's air and it shouldn't be
new GoalBlock(pos.up())
// it's a block and it shouldn't be
// todo disallow right above
: new GoalGetToBlock(pos) // replace with GoalTwoBlocks to mine using pathfinding system only
).toArray(Goal[]::new);
}

View File

@ -240,7 +240,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
return true;
}
if (msg.startsWith("build")) {
String file = msg.substring(5) + ".schematic";
String file = msg.substring(6) + ".schematic";
logDirect("" + baritone.getBuilderProcess().build(file));
return true;
}