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

ViaVersion incompatibility? #982

Closed
xMrAfonso opened this issue Sep 7, 2024 · 8 comments · Fixed by #1004
Closed

ViaVersion incompatibility? #982

xMrAfonso opened this issue Sep 7, 2024 · 8 comments · Fixed by #1004
Labels
bug Something isn't working

Comments

@xMrAfonso
Copy link

Describe the bug
When pinging and joining the server, I get this error.

Software brand
Using Paper 1.20.6-149

Plugins
ViaVersion 5.0.3 (tried using snapshots of 5.0.4 and 5.0.2 but none worked either) and my own Plugin that uses PacketEvents.

@xMrAfonso xMrAfonso added the bug Something isn't working label Sep 7, 2024
@AoElite
Copy link
Contributor

AoElite commented Sep 7, 2024

@xMrAfonso Are you using ViaVersion on the proxy or the backend?

@xMrAfonso
Copy link
Author

@xMrAfonso Are you using ViaVersion on the proxy or the backend?

I have no proxy, this is just a standalone server.

@xMrAfonso
Copy link
Author

Any news on this?

@booky10
Copy link
Collaborator

booky10 commented Sep 13, 2024

works for me when using paper 1.20.6 build 149, packetevents 2bf64b6, viaversion 954 and viabackwards 494
is there any specific client version where this error occurs? do you have any other plugins installed?

@xMrAfonso
Copy link
Author

works for me when using paper 1.20.6 build 149, packetevents 2bf64b6, viaversion 954 and viabackwards 494 is there any specific client version where this error occurs? do you have any other plugins installed?

I do not, could you maybe check out my code? It's a project called Runway in my github. PS: PacketEvents version is not updated there.

@booky10
Copy link
Collaborator

booky10 commented Sep 14, 2024

this problem is caused by how you depend on packetevents

packetevents determines presence of viaversion by looking up if the plugin is registered
as you use the library-loader of paper plugins, your plugin (and therefore also packetevents) can't access viaversion classes and fails

there are multiple different solutions to this problem, but this cant be solved by packetevents:

  1. dont use paper plugins (or set has-open-classloader to true, I wouldnt recommend doing this)
  2. dont shade packetevents and dont use the library-loader to load it, just depend on the plugin-version of it
  3. add ViaVersion as a non-required dependency to your paper-plugin config, therefore allowing packetevents to access its classes

@booky10 booky10 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2024
@xMrAfonso
Copy link
Author

this problem is caused by how you depend on packetevents

packetevents determines presence of viaversion by looking up if the plugin is registered as you use the library-loader of paper plugins, your plugin (and therefore also packetevents) can't access viaversion classes and fails

there are multiple different solutions to this problem, but this cant be solved by packetevents:

  1. dont use paper plugins (or set has-open-classloader to true, I wouldnt recommend doing this)
  2. dont shade packetevents and dont use the library-loader to load it, just depend on the plugin-version of it
  3. add ViaVersion as a non-required dependency to your paper-plugin config, therefore allowing packetevents to access its classes

Hey, I already added ViaVersion as a soft dependency... still the same issue:

ViaVersion:
  load: BEFORE
  required: false
  join-classpath: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants