diff --git a/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java b/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java index 41b6ff55..b612e342 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java +++ b/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java @@ -11,6 +11,8 @@ import java.util.Locale; import java.util.Objects; import java.util.stream.Stream; +import static baritone.api.utils.Helper.HELPER; + public class RelativeFile implements IDatatypePost { private final Path path; @@ -48,4 +50,14 @@ public class RelativeFile implements IDatatypePost { public File apply(File original) { return original.toPath().resolve(path).toFile(); } + + public static File gameDir() { + File gameDir = HELPER.mc.gameDir.getAbsoluteFile(); + + if (gameDir.getName().equals(".")) { + return gameDir.getParentFile(); + } + + return gameDir; + } } diff --git a/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java b/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java index 6b257012..1dd48512 100644 --- a/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java @@ -67,7 +67,7 @@ public class ExploreFilterCommand extends Command { @Override protected Stream tabCompleted(String label, ArgConsumer args, Settings settings) { if (args.hasExactlyOne()) { - return RelativeFile.tabComplete(args, MC.gameDir.getAbsoluteFile().getParentFile()); + return RelativeFile.tabComplete(args, RelativeFile.gameDir()); } return Stream.empty();