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

Type Signature of Targeted Method in LoginListener has changed in 1.20.2 #22

Closed
TigerWalts opened this issue Sep 21, 2023 · 5 comments
Closed

Comments

@TigerWalts
Copy link

Using VanillaCord build 22w24b

VanillaCord 1.8
Searching versions
Downloading Minecraft Server 1.20.2
Running the self-extracting server bundle
Loading server bytecode
Found the handshake listener in alq.class
Found the login listener in alr.class
Patching classes
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at uk.co.thinkofdeath.vanillacord.packager.BEv1.edit(BEv1.java:97)
        at uk.co.thinkofdeath.vanillacord.packager.BundleEditor.main(BundleEditor.java:59)
        at net.minecraft.bundler.Main.lambda$run$0(Main.java:54)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Inject failed
        at uk.co.thinkofdeath.vanillacord.patcher.LoginListener$1.visitEnd(LoginListener.java:143)
        at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1518)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:744)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
        at uk.co.thinkofdeath.vanillacord.patcher.Patcher.patch(Patcher.java:146)
        ... 8 more

In 1.20.2 the method now accepts a String instead of a GameProfile.

1.20.1

    protected GameProfile a(final GameProfile $$0) {
        final UUID $$ = hy.a($$0.getName());
        return new GameProfile($$, $$0.getName());
    }

1.20.2

    protected static GameProfile b(final String $$0) {
        final UUID $$ = hx.a($$0);
        return new GameProfile($$, $$0);
    }
@AceFrax
Copy link

AceFrax commented Oct 13, 2023

Hi, have you found a fix?

@TigerWalts
Copy link
Author

No. It isn't just the method above that has changed, adding a clause to patch whichever variant is in the class is the easy part.

The sticking point is that the patcher first analyses another method in the same class to discover some class or variable names for later use. The method has had a bit of a refactor so the patcher fails to retrieve what it needs.

@AceFrax
Copy link

AceFrax commented Oct 17, 2023

Yeah, that's the reason I edited my comment. I realized that immediately when trying to patch the issue.

I'll let you know if I manage to adapt it for 1.20.2

@onlyv1
Copy link

onlyv1 commented Nov 12, 2023

Yeah, that's the reason I edited my comment. I realized that immediately when trying to patch the issue.

I'll let you know if I manage to adapt it for 1.20.2

news?

ME1312 added a commit that referenced this issue Dec 19, 2023
This commit is a complete rewrite of VanillaCord. Resolves #8 and #22
@ME1312
Copy link
Owner

ME1312 commented Dec 21, 2023

So, to clear this up, here's what was going on:

  • They caused #17 again (This is what the error is about)
  • They detached the method that we used to override a players' GameProfile from the login process
  • They seem to have converted many of their classes to records for some reason, even in its dependencies, which means-
  • They made a breaking change to one of our dependencies again (This specific problem spawned these forks)

VanillaCord 2.0 addresses these issues by becoming even more flexible... but still, I hope they were satisfied with their new implementation and don't make too many more major changes. 😅

@ME1312 ME1312 closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants