Skip to content

Commit f9028fd

Browse files
committed
Try to workaround install failures on pojav.
1 parent 9c72441 commit f9028fd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

loader/src/main/java/com/fox2code/foxloader/installer/InstallerDependencyHelperImpl.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
package com.fox2code.foxloader.installer;
2525

2626
import com.fox2code.foxloader.dependencies.DependencyHelper;
27+
import com.fox2code.foxloader.utils.Platform;
2728

29+
import java.io.File;
2830
import java.net.URL;
2931

3032
final class InstallerDependencyHelperImpl extends DependencyHelper.DependencyImpl {
@@ -41,6 +43,28 @@ public boolean isDev() {
4143
return true;
4244
}
4345

46+
@Override
47+
public File checkMCLibraryRoot(File mcLibraries) {
48+
if (mcLibraries == null) {
49+
String mcLibrariesPath;
50+
switch (Platform.getPlatform()) {
51+
case WINDOWS:
52+
mcLibrariesPath = System.getenv("APPDATA") + "\\.minecraft\\";
53+
break;
54+
case MACOS:
55+
mcLibrariesPath = System.getProperty("user.home") + "/Library/Application Support/minecraft/";
56+
break;
57+
case LINUX:
58+
mcLibrariesPath = System.getProperty("user.home") + "/.minecraft/";
59+
break;
60+
default:
61+
throw new RuntimeException("Unsupported operating system");
62+
}
63+
mcLibraries = new File(mcLibrariesPath + "libraries");
64+
}
65+
return mcLibraries;
66+
}
67+
4468
@Override
4569
public URL getClassResource(String className) {
4670
return InstallerDependencyHelperImpl.class.getClassLoader()

0 commit comments

Comments
 (0)