From 3a95975727146fba7f48112ec5181884bdbc93fb Mon Sep 17 00:00:00 2001 From: Xytronix <32957125+Xytronix@users.noreply.github.com> Date: Tue, 26 May 2026 08:53:00 +0200 Subject: [PATCH] fix: prioritizeLocalModClass actually swaps to the mod-jar version --- .../cc/irori/hyinit/mixin/impl/MixinPluginClassLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/irori/hyinit/mixin/impl/MixinPluginClassLoader.java b/src/main/java/cc/irori/hyinit/mixin/impl/MixinPluginClassLoader.java index bbb17a2..1b8c72b 100644 --- a/src/main/java/cc/irori/hyinit/mixin/impl/MixinPluginClassLoader.java +++ b/src/main/java/cc/irori/hyinit/mixin/impl/MixinPluginClassLoader.java @@ -37,7 +37,7 @@ public MixinPluginClassLoader(URL[] urls, ClassLoader parent) { // OrbisGuard compatibility: // When the same class is present in both the earlyplugin jar and the mod jar, prioritize the mod's. // To do this, we need to check the SourceMetadata of the loaded class. - @Inject(method = "loadClass0", at = @At(value = "RETURN", ordinal = 0), cancellable = true) + @Inject(method = "loadClass0", at = @At(value = "RETURN", ordinal = 1), cancellable = true) private void hyinit$prioritizeLocalModClass( String name, boolean useBridge, @@ -45,6 +45,7 @@ public MixinPluginClassLoader(URL[] urls, ClassLoader parent) { @Local(ordinal = 0) Class loadClass) throws ClassNotFoundException { if (loadClass == null) return; + if (loadClass.getClassLoader() == this) return; String fileName = LoaderUtil.getClassFileName(name); URL url = super.getResource(fileName); if (url != null) { @@ -53,7 +54,7 @@ public MixinPluginClassLoader(URL[] urls, ClassLoader parent) { SourceMetadata meta = SourceMetaStore.get(UrlUtil.asPath(codeSource.getLocation())); if (meta.isEarlyPlugin()) { try { - Class pluginClass = super.loadClass(name, false); + Class pluginClass = super.findClass(name); if (pluginClass != null) { cir.setReturnValue(pluginClass); }