Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ 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,
CallbackInfoReturnable<Class<?>> cir,
@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) {
Expand All @@ -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);
}
Expand Down