ProtocolLib

3M Downloads

Listening for custom payload packets does not work on protocollib 1.20.2

ThrowerWay opened this issue ยท 4 comments

commented
  • 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

commented

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

commented

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

commented

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 :(

commented

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.