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

Listening for custom payload packets does not work on protocollib 1.20.2 #2561

Closed
1 task done
ghost opened this issue Oct 8, 2023 · 4 comments · Fixed by #2568
Closed
1 task done

Listening for custom payload packets does not work on protocollib 1.20.2 #2561

ghost opened this issue Oct 8, 2023 · 4 comments · Fixed by #2568

Comments

@ghost
Copy link

ghost commented Oct 8, 2023

  • This issue is not solved in a development build

Describe the bug
Listening for custom payload packets does not work on protocollib 1.20.2

To Reproduce
Make a packet listener for custom payload

Expected behavior
Should detect it from player, doesnt.

Screenshots
If applicable, add screenshots to help explain your problem.

Version Info
5.1.1-SNAPSHOT-669

@Waterman1001
Copy link

Perhaps this issue is related to my issue: #2552
A fix would be highly appreciated!

@ghost
Copy link
Author

ghost commented Oct 10, 2023

I fixed it by using packet events, doesn't seem like there will be a fix anytime soon, since no plib update since sept 23

@Waterman1001
Copy link

Thanks for your reply!
What kind of packet events are you using? Because for my own issue, specifically listening to Keep Alive packet and Pong packet is not working...
Indeed, it takes long for update unfortunately :(

@ghost
Copy link
Author

ghost commented Oct 13, 2023

Thanks for your reply! What kind of packet events are you using? Because for my own issue, specifically listening to Keep Alive packet and Pong packet is not working... Indeed, it takes long for update unfortunately :(

I meant the packet events plugin, but I have had to switch back to protocollib due to packet events causing issues with tab complete, using your patch I can get custom payload packets but the packet types for them is wonky (meaning I cant check if event.getPacketType() == PacketType.Play.Client.CUSTOM_PAYLOAD etc)

PacketType.Play.Client.CUSTOM_PAYLOAD, PacketType.Login.Client.CUSTOM_PAYLOAD, PacketType.Configuration.Client.CUSTOM_PAYLOAD,

System.out.println("type: " + event.getPacketType().toString());

[10:26:27 INFO]: [STDOUT] type: null[class=ServerboundCustomPayloadPacket, id=1]
[10:26:28 INFO]: [STDOUT] type: Dynamic-aa43bcce-b1d4-478c-9272-7e63f744e3ea[class=ServerboundCustomPayloadPacket, id=15]

i am having to use if (event.getPacketType().getPacketClass().getSimpleName().equals("ServerboundCustomPayloadPacket")) {
to match the payload packets.

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

Successfully merging a pull request may close this issue.

1 participant