Skip to content

Commit

Permalink
Mimic Mixin behavior on ForceLoadAsMod
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Jul 5, 2024
1 parent b5cfa24 commit 93765d5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

public class CoreModManager {
private static final Attributes.Name COREMODCONTAINSFMLMOD = new Attributes.Name("FMLCorePluginContainsFMLMod");
private static final Attributes.Name FORCELOADASMOD = new Attributes.Name("ForceLoadAsMod");
private static final Attributes.Name MODTYPE = new Attributes.Name("ModType");
private static String[] rootPlugins = { "net.minecraftforge.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin", "net.minecraftforge.fml.relauncher.MixinBooterPlugin" };
private static List<String> ignoredModFiles = Lists.newArrayList();
Expand Down Expand Up @@ -419,7 +420,7 @@ private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader)
{
// Not a coremod
FMLLog.log.debug("Not found coremod data in {}", coreMod.getName());
if (MixinServiceLaunchWrapper.MIXIN_TWEAKER_CLASS.equals(cascadedTweaker) && mfAttributes.containsKey(COREMODCONTAINSFMLMOD)) {
if (MixinServiceLaunchWrapper.MIXIN_TWEAKER_CLASS.equals(cascadedTweaker) && (mfAttributes.containsKey(COREMODCONTAINSFMLMOD) || mfAttributes.containsKey(FORCELOADASMOD))) {
FMLLog.log.info("Found FMLCorePluginContainsFMLMod marker in mixin container {}.",
coreMod.getName());
candidateModFiles.add(coreMod.getName());
Expand Down Expand Up @@ -448,7 +449,7 @@ private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader)
classLoader.addURL(coreMod.toURI().toURL());
if (!Strings.isNullOrEmpty(configs))
mixin_configs.addAll(List.of(configs.split(",")));
if (!mfAttributes.containsKey(COREMODCONTAINSFMLMOD))
if (!(mfAttributes.containsKey(COREMODCONTAINSFMLMOD) || mfAttributes.containsKey(FORCELOADASMOD)))
{
FMLLog.log.trace("Adding {} to the list of known coremods, it will not be examined again", coreMod.getName());
ignoredModFiles.add(coreMod.getName());
Expand Down

0 comments on commit 93765d5

Please sign in to comment.