Add in "FMLCorePluginContainsMod" in the manifest. If this value is
present, FML will attempt to parse your mod jar file as a normal mod file as well, instantiating mod containers there.
This commit is contained in:
parent
8f9b54a97a
commit
643e3d441a
2 changed files with 19 additions and 1 deletions
|
@ -42,8 +42,12 @@ public class ModDiscoverer
|
||||||
public void findClasspathMods(ModClassLoader modClassLoader)
|
public void findClasspathMods(ModClassLoader modClassLoader)
|
||||||
{
|
{
|
||||||
List<String> knownLibraries = ImmutableList.<String>builder()
|
List<String> knownLibraries = ImmutableList.<String>builder()
|
||||||
|
// skip default libs
|
||||||
.addAll(modClassLoader.getDefaultLibraries())
|
.addAll(modClassLoader.getDefaultLibraries())
|
||||||
|
// skip loaded coremods
|
||||||
.addAll(CoreModManager.getLoadedCoremods())
|
.addAll(CoreModManager.getLoadedCoremods())
|
||||||
|
// skip reparse coremods here
|
||||||
|
.addAll(CoreModManager.getReparseableCoremods())
|
||||||
.build();
|
.build();
|
||||||
File[] minecraftSources = modClassLoader.getParentSources();
|
File[] minecraftSources = modClassLoader.getParentSources();
|
||||||
if (minecraftSources.length == 1 && minecraftSources[0].isFile())
|
if (minecraftSources.length == 1 && minecraftSources[0].isFile())
|
||||||
|
@ -85,6 +89,7 @@ public class ModDiscoverer
|
||||||
|
|
||||||
for (File modFile : modList)
|
for (File modFile : modList)
|
||||||
{
|
{
|
||||||
|
// skip loaded coremods
|
||||||
if (CoreModManager.getLoadedCoremods().contains(modFile.getName()))
|
if (CoreModManager.getLoadedCoremods().contains(modFile.getName()))
|
||||||
{
|
{
|
||||||
FMLLog.finer("Skipping already parsed coremod or tweaker %s", modFile.getName());
|
FMLLog.finer("Skipping already parsed coremod or tweaker %s", modFile.getName());
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class CoreModManager
|
||||||
private static boolean deobfuscatedEnvironment;
|
private static boolean deobfuscatedEnvironment;
|
||||||
private static FMLTweaker tweaker;
|
private static FMLTweaker tweaker;
|
||||||
private static File mcDir;
|
private static File mcDir;
|
||||||
|
private static List<String> reparsedCoremods;
|
||||||
|
|
||||||
private static class FMLPluginWrapper
|
private static class FMLPluginWrapper
|
||||||
{
|
{
|
||||||
|
@ -210,7 +211,14 @@ public class CoreModManager
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
classLoader.addURL(coreMod.toURI().toURL());
|
classLoader.addURL(coreMod.toURI().toURL());
|
||||||
loadedCoremods.add(coreMod.getName());
|
if (!mfAttributes.containsValue("FMLCorePluginContainsFMLMod"))
|
||||||
|
{
|
||||||
|
loadedCoremods.add(coreMod.getName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reparsedCoremods.add(coreMod.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (MalformedURLException e)
|
catch (MalformedURLException e)
|
||||||
{
|
{
|
||||||
|
@ -267,6 +275,11 @@ public class CoreModManager
|
||||||
return loadedCoremods;
|
return loadedCoremods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<String> getReparseableCoremods()
|
||||||
|
{
|
||||||
|
return reparsedCoremods;
|
||||||
|
}
|
||||||
|
|
||||||
private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location)
|
private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location)
|
||||||
{
|
{
|
||||||
String coreModName = coreModClass.substring(coreModClass.lastIndexOf('.')+1);
|
String coreModName = coreModClass.substring(coreModClass.lastIndexOf('.')+1);
|
||||||
|
|
Loading…
Reference in a new issue