From fdcec1958304d89d51b2fef31ba82829f4e1ec0d Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 11 Feb 2023 18:51:19 +0100 Subject: [PATCH] Update javadoc for the reparseable coremod handling There was a small inaccuracy in the commit message of a8217ef28022caa090f59b14e61d8b260c2a2c1d: Everything I said about "extra mods" also applies to mod directory mods (FML treats the two sets as one). --- .../platform/MixinPlatformAgentFMLLegacy.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/launchwrapper/java/org/spongepowered/asm/launch/platform/MixinPlatformAgentFMLLegacy.java b/src/launchwrapper/java/org/spongepowered/asm/launch/platform/MixinPlatformAgentFMLLegacy.java index 6d82c290..858a3e56 100644 --- a/src/launchwrapper/java/org/spongepowered/asm/launch/platform/MixinPlatformAgentFMLLegacy.java +++ b/src/launchwrapper/java/org/spongepowered/asm/launch/platform/MixinPlatformAgentFMLLegacy.java @@ -181,9 +181,10 @@ public class MixinPlatformAgentFMLLegacy extends MixinPlatformAgentAbstract impl * fml to subsequently re-evaluate the container for coremod candidacy. * *

Further, if the "fml core plugin contains fml mod" flag is set in the - * manifest, the container will be manually injected by this agent into the - * "reparseable coremods" collection which will cause it to be crawled for - * regular mods as well.

+ * manifest and the mod is not on the boot class path, the container will + * be manually injected by this agent into the "reparseable coremods" + * collection, which will prevent fml from crawling it multiple times for + * regular mods and constructing duplicate mod containers.

*/ private void loadAsMod() { try { @@ -202,6 +203,16 @@ public class MixinPlatformAgentFMLLegacy extends MixinPlatformAgentAbstract impl } } + /** + *

Reparseable coremods are excluded from being crawled for regular mods + * during class path mod discovery, so we must not add mods on the + * boot class path to this list.

+ *

The reason we use the boot class path is because coremods in + * the mods directory have been injected into the class path at this point, + * and we do want to mark those as reparseable, so they don't get + * crawled during both the class path and mod directory mod + * discovery steps. + */ private boolean isIgnoredReparseable() { return System.getProperty("java.class.path").contains(this.fileName); }