ProtocolLib

3M Downloads

Regression bug in commit af33a2ab41199f7c564a5ca9f919e91822532cf4

nickuc opened this issue ยท 3 comments

commented
  • This issue is not solved in a development build

Describe the bug
When registering an event that listens for the handshake packet (SET_PROTOCOL), an "Incompatible version!" will appear in motd. This bug was introduced in build #670 (most likely by commit af33a2a). Build #669 does not have the same problem.

To Reproduce
Steps to reproduce the behavior:

  1. Download and install latest build.
  2. Intercept the SET_PROTOCOL packet as the following example:
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Handshake.Client.SET_PROTOCOL) {
      @Override
      public void onPacketReceiving(PacketEvent event) {
            // packet received
      }
});
  1. See error

Expected behavior
Have the same behavior as build #669.

Screenshots
#669

#670

Version Info
Provide your ProtocolLib install info with /protocol dump through pastebin.

Additional context
No additional context.

commented

#2593 seems to be the same problem

commented

The problem is PacketType.Handshake.Client.SET_PROTOCOL packet changes client protocol before calling NetworkManagerInjector.onPacketReceiving(). So in NetworkManagerInjector.onPacketReceiving() ProtocolLib tries to get PacketType by PacketType.Protocol.STATUS or PacketType.Protocol.LOGIN protocols, but not PacketType.Protocol.HANDSHAKING which is actually stored in PacketRegistry.REGISTER.protocolClassToType.
That is why PacketRegistry.getPacketType(PacketType.Protocol, Class<?>) returns null and tries to create PacketContainer with null PacketType.

UPD: There are high amount of issues coming in right now due to:

  • Many people are using the ProtocolLib release from SpigotMC (v5.1.0)
  • Many people are using 1.20 or 1.20.1 server software instead of 1.20.2
  • Those using the latest development build are getting the issue described here

In addition, most issues lack the necessary technical information. Therefore, I would recommend to fix this issue ASAP and public it on SpigotMC. Below is a long list of issues that can be related with described situation