diff --git a/pom.xml b/pom.xml
index 2a05cb2..bdc462e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
me.skymc
TabooLib
- 4.57
+ 4.58
UTF-8
diff --git a/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleClassVisitor.java b/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleClassVisitor.java
index b58055c..b17c54c 100644
--- a/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleClassVisitor.java
+++ b/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleClassVisitor.java
@@ -24,22 +24,27 @@ public class SimpleClassVisitor extends ClassVisitor {
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
- super.visit(version, access, name, translate(signature), translate(superName), translate(interfaces));
+ super.visit(version, access, translate(name), translate(signature), translate(superName), translate(interfaces));
}
@Override
public void visitInnerClass(String name, String outerName, String innerName, int access) {
- super.visitInnerClass(name, translate(outerName), translate(innerName), access);
+ super.visitInnerClass(translate(name), translate(outerName), translate(innerName), access);
}
@Override
public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) {
- return super.visitField(access, name, translate(descriptor), translate(signature), value);
+ return super.visitField(access, translate(name), translate(descriptor), translate(signature), value instanceof String ? translate((String) value) : value);
+ }
+
+ @Override
+ public void visitOuterClass(String owner, String name, String descriptor) {
+ super.visitOuterClass(translate(owner), translate(name), translate(descriptor));
}
@Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
- return new SimpleMethodVisitor(simpleVersionControl, super.visitMethod(access, name, translate(descriptor), translate(signature), translate(exceptions)));
+ return new SimpleMethodVisitor(simpleVersionControl, super.visitMethod(access, translate(name), translate(descriptor), translate(signature), translate(exceptions)));
}
private String translate(String target) {
diff --git a/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleMethodVisitor.java b/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleMethodVisitor.java
index ab458db..292d81a 100644
--- a/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleMethodVisitor.java
+++ b/src/main/java/me/skymc/taboolib/common/versioncontrol/SimpleMethodVisitor.java
@@ -1,8 +1,6 @@
package me.skymc.taboolib.common.versioncontrol;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.*;
import java.util.stream.IntStream;
@@ -21,6 +19,11 @@ public class SimpleMethodVisitor extends MethodVisitor {
this.simpleVersionControl = simpleVersionControl;
}
+ @Override
+ public void visitParameter(String name, int access) {
+ super.visitParameter(translate(name), access);
+ }
+
@Override
public void visitMethodInsn(int opcode, String owner, String name, String descriptor) {
super.visitMethodInsn(opcode, translate(owner), translate(name), translate(descriptor));
@@ -33,7 +36,11 @@ public class SimpleMethodVisitor extends MethodVisitor {
@Override
public void visitLdcInsn(Object value) {
- super.visitLdcInsn(value instanceof String ? translate((String) value) : value);
+ if (value instanceof Type) {
+ super.visitLdcInsn(Type.getType(translate(((Type) value).getDescriptor())));
+ } else {
+ super.visitLdcInsn(value);
+ }
}
@Override
@@ -43,7 +50,7 @@ public class SimpleMethodVisitor extends MethodVisitor {
@Override
public void visitFieldInsn(int opcode, String owner, String name, String descriptor) {
- super.visitFieldInsn(opcode, translate(owner), name, translate(descriptor));
+ super.visitFieldInsn(opcode, translate(owner), translate(name), translate(descriptor));
}
@Override
@@ -51,6 +58,11 @@ public class SimpleMethodVisitor extends MethodVisitor {
super.visitLocalVariable(translate(name), translate(descriptor), translate(signature), start, end, index);
}
+ @Override
+ public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) {
+ super.visitInvokeDynamicInsn(translate(name), translate(descriptor), bootstrapMethodHandle, bootstrapMethodArguments);
+ }
+
private String translate(String target) {
return target == null ? null : simpleVersionControl.replace(target);
}