Skip to content

Commit 067b2b6

Browse files
Big-Iron-CheemsMineGame159
authored andcommitted
Dedicated mod folder retrieval method
1 parent de34094 commit 067b2b6

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

  • src/launcher/java/meteordevelopment/meteorclient

src/launcher/java/meteordevelopment/meteorclient/Main.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,26 @@ public static void main(String[] args) throws UnsupportedLookAndFeelException, C
3434
getOS().open("https://meteorclient.com/faq/installation");
3535
break;
3636
case 1: {
37-
String path;
38-
39-
switch (getOS()) {
40-
case WINDOWS:
41-
path = System.getenv("AppData") + "/.minecraft/mods";
42-
break;
43-
case OSX:
44-
path = System.getProperty("user.home") + "/Library/Application Support/minecraft/mods";
45-
break;
46-
default:
47-
path = System.getProperty("user.home") + "/.minecraft";
48-
break;
49-
}
50-
51-
File mods = new File(path);
37+
File mods = new File(getModsFolder());
5238
if (!mods.exists()) mods.mkdirs();
53-
5439
getOS().open(mods);
5540
break;
5641
}
5742
}
5843
}
5944

45+
private static String getModsFolder() {
46+
String userHome = System.getProperty("user.home");
47+
switch (getOS()) {
48+
case WINDOWS:
49+
return System.getenv("AppData") + "/.minecraft/mods";
50+
case OSX:
51+
return userHome + "/Library/Application Support/minecraft/mods";
52+
default:
53+
return userHome + "/.minecraft/mods";
54+
}
55+
}
56+
6057
private static OperatingSystem getOS() {
6158
String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
6259

0 commit comments

Comments
 (0)