fix NPE registering forge events (#547)

This commit is contained in:
Liangbai 2022-04-13 21:46:40 +08:00 committed by GitHub
parent 195045b00b
commit 2b26363b11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,7 @@ public class PluginEventHandler extends ASMEventHandler {
}
cw.visitEnd();
byte[] bytes = cw.toByteArray();
return Unsafe.defineClass(name, bytes, 0, bytes.length, plugin.getClass().getClassLoader(), plugin.getClass().getProtectionDomain());
return Unsafe.defineClass(name, bytes, 0, bytes.length, callback.getDeclaringClass().getClassLoader(), callback.getDeclaringClass().getProtectionDomain());
}
@Override