mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 04:32:33 +00:00
Invoke injected callbacks virtually if visible from subclasses
This commit is contained in:
1 parent
5dba9e5848
commit
cd5f40a0b9
2 files changed
+6
-2
No files matched your search
@@ -195,7 +195,9 @@ public class CallbackInjector extends Injector {
|
||||
}
|
||||
|
||||
// Call the callback!
|
||||
insns.add(new MethodInsnNode(this.isStatic ? Opcodes.INVOKESTATIC : Opcodes.INVOKESPECIAL,
|
||||
boolean isPrivate = (this.methodNode.access & Opcodes.ACC_PRIVATE) != 0;
|
||||
int invokeOpcode = this.isStatic ? Opcodes.INVOKESTATIC : isPrivate ? Opcodes.INVOKESPECIAL : Opcodes.INVOKEVIRTUAL;
|
||||
insns.add(new MethodInsnNode(invokeOpcode,
|
||||
this.classNode.name, this.methodNode.name, this.methodNode.desc, false));
|
||||
|
||||
if (this.cancellable) {
|
||||
|
||||
@@ -122,7 +122,9 @@ public abstract class InvokeInjector extends Injector {
|
||||
insns.add(new VarInsnNode(Opcodes.ALOAD, 0));
|
||||
}
|
||||
this.pushArgs(args, insns, argMap, startArg, endArg);
|
||||
insns.add(new MethodInsnNode(this.isStatic ? Opcodes.INVOKESTATIC : Opcodes.INVOKESPECIAL,
|
||||
boolean isPrivate = (this.methodNode.access & Opcodes.ACC_PRIVATE) != 0;
|
||||
int invokeOpcode = this.isStatic ? Opcodes.INVOKESTATIC : isPrivate ? Opcodes.INVOKESPECIAL : Opcodes.INVOKEVIRTUAL;
|
||||
insns.add(new MethodInsnNode(invokeOpcode,
|
||||
this.classNode.name, this.methodNode.name, this.methodNode.desc, false));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user