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

View File

@ -23,7 +23,11 @@ import baritone.behavior.impl.MemoryBehavior;
import baritone.behavior.impl.PathingBehavior; import baritone.behavior.impl.PathingBehavior;
import baritone.event.GameEventHandler; import baritone.event.GameEventHandler;
import baritone.utils.InputOverrideHandler; 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.ArrayList;
import java.util.List; import java.util.List;
@ -47,6 +51,7 @@ public enum Baritone {
private InputOverrideHandler inputOverrideHandler; private InputOverrideHandler inputOverrideHandler;
private Settings settings; private Settings settings;
private List<Behavior> behaviors; private List<Behavior> behaviors;
private File dir;
/** /**
* Whether or not Baritone is active * Whether or not Baritone is active
@ -66,6 +71,12 @@ public enum Baritone {
registerBehavior(LookBehavior.INSTANCE); registerBehavior(LookBehavior.INSTANCE);
registerBehavior(MemoryBehavior.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.active = true;
this.initialized = true; this.initialized = true;
@ -103,4 +114,8 @@ public enum Baritone {
public static Settings settings() { public static Settings settings() {
return Baritone.INSTANCE.settings; // yolo return Baritone.INSTANCE.settings; // yolo
} }
public final File getDir() {
return this.dir;
}
} }