mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-27 19:02:56 +00:00
Merge remote-tracking branch 'remotes/upstream/0.8' into fabric-0.8
This commit is contained in:
commit
2889361b1b
3 files changed
+14
-72
No files matched your search
@@ -746,7 +746,7 @@ public class CallbackInjector extends Injector {
|
||||
String accessor = CallbackInfoReturnable.getReturnAccessor(callback.target.returnType);
|
||||
String descriptor = CallbackInfoReturnable.getReturnDescriptor(callback.target.returnType);
|
||||
callback.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, this.callbackInfoClass, accessor, descriptor, false));
|
||||
if (callback.target.returnType.getSort() == Type.OBJECT) {
|
||||
if (callback.target.returnType.getSort() >= Type.ARRAY) {
|
||||
callback.add(new TypeInsnNode(Opcodes.CHECKCAST, callback.target.returnType.getInternalName()));
|
||||
}
|
||||
callback.add(new InsnNode(callback.target.returnType.getOpcode(Opcodes.IRETURN)));
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.tree.AnnotationNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.FieldNode;
|
||||
import org.objectweb.asm.tree.InsnNode;
|
||||
import org.objectweb.asm.tree.MethodInsnNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
@@ -148,33 +149,19 @@ class MixinPostProcessor implements MixinConfig.IListener {
|
||||
* new home in the target class
|
||||
*/
|
||||
private void processSyntheticInner(ClassNode classNode) {
|
||||
ClassVisitor visibilityVisitor = new ClassVisitor(Bytecode.ASM_API_VERSION, classNode) {
|
||||
|
||||
@Override
|
||||
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
|
||||
super.visit(version, access | Opcodes.ACC_PUBLIC, name, signature, superName, interfaces);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
|
||||
if ((access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED)) == 0) {
|
||||
access |= Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
return super.visitField(access, name, desc, signature, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
if ((access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED)) == 0) {
|
||||
access |= Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
|
||||
};
|
||||
classNode.access |= Opcodes.ACC_PUBLIC;
|
||||
|
||||
classNode.accept(visibilityVisitor);
|
||||
for (FieldNode field : classNode.fields) {
|
||||
if ((field.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED)) == 0) {
|
||||
field.access |= Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
}
|
||||
|
||||
for (MethodNode method : classNode.methods) {
|
||||
if ((method.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED)) == 0) {
|
||||
method.access |= Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean processAccessor(ClassNode classNode, MixinInfo mixin) {
|
||||
|
||||
Reference in new issue
Block a user