Skip to content

Commit 62e55a4

Browse files
Fix trying to load coremod before it in cp
1 parent ad5f359 commit 62e55a4

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/main/java/net/minecraftforge/fml/relauncher/CoreModManager.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import java.io.*;
4444
import java.lang.reflect.InvocationTargetException;
4545
import java.net.MalformedURLException;
46+
import java.net.URI;
47+
import java.net.URISyntaxException;
4648
import java.security.cert.Certificate;
4749
import java.util.*;
4850
import java.util.function.ToIntFunction;
@@ -239,6 +241,22 @@ public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTw
239241
}
240242

241243
FMLLog.log.debug("All fundamental core mods are successfully located");
244+
// Add extra classpath in advanced so fml.coreMods.load works
245+
if (System.getProperty("crl.dev.extrapath") != null)
246+
{
247+
for (String path : System.getProperty("crl.dev.extrapath").split(File.pathSeparator))
248+
{
249+
try
250+
{
251+
Launch.classLoader.addURL(new URI(path).toURL());
252+
FMLLog.log.debug("Adding extra path {} to class path", path);
253+
}
254+
catch (MalformedURLException | URISyntaxException e)
255+
{
256+
FMLLog.log.error("Failed to add path {} to class path, this souldn't happen!", path, e);
257+
}
258+
}
259+
}
242260
// Now that we have the root plugins loaded - lets see what else might
243261
// be around
244262
String commandLineCoremods = System.getProperty("fml.coreMods.load", "");
@@ -332,12 +350,7 @@ private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader)
332350
{
333351
if (coreMod.isDirectory())
334352
{
335-
FMLLog.log.debug("Coremod candidacy {} is a directory, considering as folder mod", coreMod);
336-
try {
337-
Launch.classLoader.addURL(coreMod.toURI().toURL());
338-
} catch (MalformedURLException e) {
339-
FMLLog.log.error("Coremod candidacy {} has a malformed URL", coreMod);
340-
}
353+
FMLLog.log.debug("Ignoring folder {} in coremod searching", coreMod);
341354
continue;
342355
}
343356
FMLLog.log.debug("Examining for coremod candidacy {}", coreMod.getName());

0 commit comments

Comments
 (0)