diff --git a/src/main/java/net/fabricmc/loader/launch/common/FabricMixinBootstrap.java b/src/main/java/net/fabricmc/loader/launch/common/FabricMixinBootstrap.java index 6f62a4b67..69feab043 100644 --- a/src/main/java/net/fabricmc/loader/launch/common/FabricMixinBootstrap.java +++ b/src/main/java/net/fabricmc/loader/launch/common/FabricMixinBootstrap.java @@ -130,7 +130,7 @@ public static void init(EnvType side, QuiltLoaderImpl loader) { initialized = true; } - private static final class MixinConfigDecorator { + public static final class MixinConfigDecorator { private static final List versions = new ArrayList<>(); static { @@ -152,7 +152,7 @@ static void apply(Map configToModMap) { } } - private static int getMixinCompat(ModContainerImpl mod) { + public static int getMixinCompat(ModContainerImpl mod) { // infer from loader dependency by determining the least relevant loader version the mod accepts // AND any loader deps diff --git a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java index 830da99d6..7303d6d1a 100644 --- a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java @@ -60,6 +60,7 @@ import org.quiltmc.loader.impl.game.GameProvider; import net.fabricmc.loader.launch.common.FabricLauncher; import net.fabricmc.loader.launch.common.FabricLauncherBase; +import net.fabricmc.loader.launch.common.FabricMixinBootstrap; import net.fabricmc.loader.launch.knot.Knot; import org.quiltmc.loader.impl.metadata.qmj.AdapterLoadableClassEntry; @@ -71,6 +72,8 @@ import org.quiltmc.loader.impl.util.log.Log; import org.quiltmc.loader.impl.util.log.LogCategory; +import org.spongepowered.asm.mixin.FabricUtil; + public final class QuiltLoaderImpl { public static final QuiltLoaderImpl INSTANCE = InitHelper.get(); @@ -259,6 +262,19 @@ private void setup() throws ModResolutionException { } } + // Keep Mixin 0.9.2 compatible mods first in the load order, temporary fix for https://github.com/FabricMC/Mixin/issues/89 + List newMixinCompatMods = new ArrayList<>(); + for (Iterator it = modCandidates.iterator(); it.hasNext();) { + ModCandidate mod = it.next(); + ModContainerImpl tempModContainer = new ModContainerImpl(mod); + if (FabricMixinBootstrap.MixinConfigDecorator.getMixinCompat(tempModContainer) != FabricUtil.COMPATIBILITY_0_9_2) { + it.remove(); + newMixinCompatMods.add(mod); + } + } + + modCandidates.addAll(newMixinCompatMods); + String modsToLoadLate = System.getProperty(SystemProperties.DEBUG_LOAD_LATE); if (modsToLoadLate != null) {