baritone dir

This commit is contained in:
Leijurv 2018-08-22 14:59:54 -07:00
parent d9a00ce164
commit 1251b515fa
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 15 additions and 0 deletions

View File

@ -23,7 +23,11 @@ import baritone.behavior.impl.MemoryBehavior;
import baritone.behavior.impl.PathingBehavior;
import baritone.event.GameEventHandler;
import baritone.utils.InputOverrideHandler;
import net.minecraft.client.Minecraft;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
@ -47,6 +51,7 @@ public enum Baritone {
private InputOverrideHandler inputOverrideHandler;
private Settings settings;
private List<Behavior> behaviors;
private File dir;
/**
* Whether or not Baritone is active
@ -66,6 +71,12 @@ public enum Baritone {
registerBehavior(LookBehavior.INSTANCE);
registerBehavior(MemoryBehavior.INSTANCE);
}
this.dir = new File(Minecraft.getMinecraft().gameDir, "baritone");
if (!Files.exists(dir.toPath())) {
try {
Files.createDirectories(dir.toPath());
} catch (IOException ignored) {}
}
this.active = true;
this.initialized = true;
@ -103,4 +114,8 @@ public enum Baritone {
public static Settings settings() {
return Baritone.INSTANCE.settings; // yolo
}
public final File getDir() {
return this.dir;
}
}