From 1251b515faf09e74e3c6a8e28d8d71a653131437 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 22 Aug 2018 14:59:54 -0700 Subject: [PATCH] baritone dir --- src/main/java/baritone/Baritone.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/baritone/Baritone.java b/src/main/java/baritone/Baritone.java index 31f37235..8a8720ce 100755 --- a/src/main/java/baritone/Baritone.java +++ b/src/main/java/baritone/Baritone.java @@ -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 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; + } }