Coremods can be specified via the command line: fml.coreMod.load=<listofcommaseparatedclasses> This will help with developing coremods
This commit is contained in:
parent
4aced4ae02
commit
4c39831d2b
1 changed files with 36 additions and 0 deletions
|
@ -63,6 +63,42 @@ public class RelaunchLibraryManager
|
||||||
|
|
||||||
downloadMonitor.updateProgressString("All core mods are successfully located");
|
downloadMonitor.updateProgressString("All core mods are successfully located");
|
||||||
// Now that we have the root plugins loaded - lets see what else might be around
|
// 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);
|
discoverCoreMods(mcDir, actualClassLoader, loadPlugins, libraries);
|
||||||
|
|
||||||
List<Throwable> caughtErrors = new ArrayList<Throwable>();
|
List<Throwable> caughtErrors = new ArrayList<Throwable>();
|
||||||
|
|
Loading…
Reference in a new issue