Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 1.20.2 can not view skin #226

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ public Optional<ClassVisitor> 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)) {
xmdhs marked this conversation as resolved.
Show resolved Hide resolved
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);
xmdhs marked this conversation as resolved.
Show resolved Hide resolved
mv.visitEnd();
}
if ("signature".equals(name)) {
xmdhs marked this conversation as resolved.
Show resolved Hide resolved
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);
xmdhs marked this conversation as resolved.
Show resolved Hide resolved
mv.visitEnd();
}
if ("isSignatureValid".equals(name) && "(Ljava/security/PublicKey;)Z".equals(desc)) {
ctx.markModified();

Expand Down