Forge will now load extra mods from mods/mod_list.json and mods/mc_version/mod_list.json.
As defined by the same json spec as --modListFile. And now if repositoryRoot is prefixed with absolute: the path will NOT be relative to the MC directory.
This commit is contained in:
parent
6ad65f4e64
commit
72f7c0be1f
1 changed files with 17 additions and 1 deletions
|
@ -62,12 +62,28 @@ public class ModListHelper {
|
||||||
tryAddFile(modFile, null, modFile);
|
tryAddFile(modFile, null, modFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String[] extras = new String[]
|
||||||
|
{
|
||||||
|
"mods/mod_list.json",
|
||||||
|
"mods/" + FMLInjectionData.mccversion + "/mod_list.json"
|
||||||
|
};
|
||||||
|
|
||||||
|
for (String extra : extras)
|
||||||
|
{
|
||||||
|
if ((new File(mcDirectory, extra)).exists())
|
||||||
|
parseListFile(extra);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private static void parseListFile(String listFile) {
|
private static void parseListFile(String listFile) {
|
||||||
File f;
|
File f;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
f = new File(mcDirectory, listFile).getCanonicalFile();
|
if (listFile.startsWith("absolute:"))
|
||||||
|
f = new File(listFile.substring(9)).getCanonicalFile();
|
||||||
|
else
|
||||||
|
f = new File(mcDirectory, listFile).getCanonicalFile();
|
||||||
} catch (IOException e2)
|
} catch (IOException e2)
|
||||||
{
|
{
|
||||||
FMLRelaunchLog.log(Level.INFO, e2, "Unable to canonicalize path %s relative to %s", listFile, mcDirectory.getAbsolutePath());
|
FMLRelaunchLog.log(Level.INFO, e2, "Unable to canonicalize path %s relative to %s", listFile, mcDirectory.getAbsolutePath());
|
||||||
|
|
Loading…
Reference in a new issue