fixed
This commit is contained in:
parent
251110c4f8
commit
c45cbebcce
@ -41,6 +41,7 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraft.util.math.Vec3i;
|
import net.minecraft.util.math.Vec3i;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -60,9 +61,11 @@ public class BuilderProcess extends BaritoneProcessHelper {
|
|||||||
|
|
||||||
public boolean build(String schematicFile) {
|
public boolean build(String schematicFile) {
|
||||||
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());
|
||||||
|
|
||||||
NBTTagCompound tag;
|
NBTTagCompound tag;
|
||||||
try {
|
try (FileInputStream fileIn = new FileInputStream(file)) {
|
||||||
tag = CompressedStreamTools.read(file);
|
tag = CompressedStreamTools.readCompressed(fileIn);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
@ -107,6 +110,7 @@ public class BuilderProcess extends BaritoneProcessHelper {
|
|||||||
// it's air and it shouldn't be
|
// it's air and it shouldn't be
|
||||||
new GoalBlock(pos.up())
|
new GoalBlock(pos.up())
|
||||||
// it's a block and it shouldn't be
|
// 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
|
: new GoalGetToBlock(pos) // replace with GoalTwoBlocks to mine using pathfinding system only
|
||||||
).toArray(Goal[]::new);
|
).toArray(Goal[]::new);
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (msg.startsWith("build")) {
|
if (msg.startsWith("build")) {
|
||||||
String file = msg.substring(5) + ".schematic";
|
String file = msg.substring(6) + ".schematic";
|
||||||
logDirect("" + baritone.getBuilderProcess().build(file));
|
logDirect("" + baritone.getBuilderProcess().build(file));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user