diff --git a/src/main/java/moe/yushi/authlibinjector/transform/support/YggdrasilKeyTransformUnit.java b/src/main/java/moe/yushi/authlibinjector/transform/support/YggdrasilKeyTransformUnit.java index 8145491..7aece95 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/support/YggdrasilKeyTransformUnit.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/support/YggdrasilKeyTransformUnit.java @@ -139,6 +139,21 @@ public Optional transform(ClassLoader classLoader, String classNam return Optional.of(new ClassVisitor(ASM9, writer) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { + if ("value".equals(name) && "()Ljava/lang/String;".equals(desc)) { + MethodVisitor mv = writer.visitMethod(access, "getValue", desc, signature, exceptions); + mv.visitVarInsn(ALOAD, 0); + mv.visitFieldInsn(GETFIELD, "com/mojang/authlib/properties/Property", "value", "Ljava/lang/String;"); + mv.visitInsn(ARETURN); + mv.visitMaxs(-1, -1); + mv.visitEnd(); + } else if ("signature".equals(name) && "()Ljava/lang/String;".equals(desc)) { + MethodVisitor mv = writer.visitMethod(access, "getSignature", desc, signature, exceptions); + mv.visitVarInsn(ALOAD, 0); + mv.visitFieldInsn(GETFIELD, "com/mojang/authlib/properties/Property", "signature", "Ljava/lang/String;"); + mv.visitInsn(ARETURN); + mv.visitMaxs(-1, -1); + mv.visitEnd(); + } if ("isSignatureValid".equals(name) && "(Ljava/security/PublicKey;)Z".equals(desc)) { ctx.markModified();