mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix library path and soft fail when repository root is not found.
This commit is contained in:
1 parent
68ce80dad4
commit
34f4381e0c
2 files changed
+9
-5
No files matched your search
@@ -133,13 +133,13 @@ public class LibraryManager
|
||||
apache = apache.getParentFile(); //Get to a directory, this *should* always be the case...
|
||||
apache = apache.getParentFile(); //Skip the version folder. In case we ever update the version, I don't want to edit this code again.
|
||||
|
||||
if (!apache.getAbsolutePath().toLowerCase(Locale.ENGLISH).replace(File.separatorChar, '/').endsWith("/org/apache/maven/maven/"))
|
||||
if (!apache.getAbsolutePath().toLowerCase(Locale.ENGLISH).replace(File.separatorChar, '/').endsWith("/org/apache/maven/maven-artifact/"))
|
||||
{
|
||||
FMLLog.log.error("Apache Maven library folder was not in the format expected: {}. Using default libraries directory.", new File(source.getLocation().toURI()));
|
||||
return new File(minecraftHome, "libraries");
|
||||
}
|
||||
// maven /maven /apache /org /libraries
|
||||
return apache.getParentFile().getParentFile().getParentFile().getParentFile();
|
||||
// maven-artifact /maven /apache /org /libraries
|
||||
return apache .getParentFile().getParentFile().getParentFile().getParentFile();
|
||||
}
|
||||
catch (URISyntaxException e)
|
||||
{
|
||||
|
||||
@@ -140,7 +140,11 @@ public class ModList
|
||||
{
|
||||
try
|
||||
{
|
||||
temp = Repository.create(getFile(mcdir, this.mod_list.repositoryRoot));
|
||||
File repoFile = getFile(mcdir, this.mod_list.repositoryRoot);
|
||||
if (repoFile != null)
|
||||
{
|
||||
temp = Repository.create(repoFile);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
@@ -205,7 +209,7 @@ public class ModList
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
FMLLog.log.info(FMLLog.log.getMessageFactory().newMessage("Unable to canonicalize path {} relative to {}", path, root.getAbsolutePath()), ioe);
|
||||
FMLLog.log.info(FMLLog.log.getMessageFactory().newMessage("Unable to canonicalize path {} relative to {}", path, root.getAbsolutePath()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user