File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
loader/src/main/java/com/fox2code/foxloader/installer Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 2424package com .fox2code .foxloader .installer ;
2525
2626import com .fox2code .foxloader .dependencies .DependencyHelper ;
27+ import com .fox2code .foxloader .utils .Platform ;
2728
29+ import java .io .File ;
2830import java .net .URL ;
2931
3032final 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 ()
You can’t perform that action at this time.
0 commit comments