mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Coremods can be specified via the command line: fml.coreMod.load=<listofcommaseparatedclasses> This will help with developing coremods
This commit is contained in:
1 parent
bae1f74681
commit
a2bc30b356
1 file changed
+36
@@ -63,6 +63,42 @@ public class RelaunchLibraryManager
|
||||
|
||||
downloadMonitor.updateProgressString("All core mods are successfully located");
|
||||
// Now that we have the root plugins loaded - lets see what else might be around
|
||||
String commandLineCoremods = System.getProperty("fml.coreMods.load","");
|
||||
for (String s : commandLineCoremods.split(","))
|
||||
{
|
||||
if (s.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
FMLRelaunchLog.info("Found a command line coremod : %s", s);
|
||||
try
|
||||
{
|
||||
actualClassLoader.addTransformerExclusion(s);
|
||||
Class<?> coreModClass = Class.forName(s, true, actualClassLoader);
|
||||
TransformerExclusions trExclusions = coreModClass.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class);
|
||||
if (trExclusions!=null)
|
||||
{
|
||||
for (String st : trExclusions.value())
|
||||
{
|
||||
actualClassLoader.addTransformerExclusion(st);
|
||||
}
|
||||
}
|
||||
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance();
|
||||
loadPlugins.add(plugin);
|
||||
if (plugin.getLibraryRequestClass()!=null)
|
||||
{
|
||||
for (String libName : plugin.getLibraryRequestClass())
|
||||
{
|
||||
libraries.add((ILibrarySet) Class.forName(libName, true, actualClassLoader).newInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE,e,"Exception occured trying to load coremod %s",s);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
discoverCoreMods(mcDir, actualClassLoader, loadPlugins, libraries);
|
||||
|
||||
List<Throwable> caughtErrors = new ArrayList<Throwable>();
|
||||
|
||||
Reference in new issue
Block a user