Skip to content

Listening to any packet under PacketType.Configuration.Server causes client to hang forever when joining  #2980

@waltermin

Description

@waltermin
  • This issue is not solved in a development build

Describe the bug
Listening to any packet under PacketType.Configuration.Server will cause the client to hang on "Joining world..." upon connection. In addition, the code in the event handler is never invoked.

To Reproduce
Minimum reproduction code below:

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;

public class BugPOC extends JavaPlugin {
  @Override
  public void onEnable() {
    ProtocolLibrary.getProtocolManager().addPacketListener(
      // finish configuration is used, though any server-sent config packet should cause the bug
      new PacketAdapter(this, PacketType.Configuration.Server.FINISH_CONFIGURATION) {
        @Override
        public void onPacketSending(PacketEvent ev) {
          getLogger().logInfo("got the packet!");
        }
      }
    );
  }
}

This also affects any code using MonitorAdapter. Since it listens to all packets, it includes PacketType.Configuration.Server, which triggers the bug.
Attached is the compiled plugin, compressed into a ZIP because GitHub doesn't allow direct JAR uploads.
BugPOC-0.0.1-SNAPSHOT.zip

Expected behavior
Client connects as normal, and the event handler is invoked.

Screenshots
image
image

Version Info
https://pastebin.com/TZ54d794

Additional context
Been going a bit crazy trying over the past few hours trying to figure out why this isn't working. 🫠 Dug through many lines of ProtocolLib and NMS code, switched to a vanilla client, pulled latest builds of ProtocolLib and Paper, removed all other plugins, and tried just about every possible fix in my own code. I'm almost certain that this is a bug in ProtocolLib. Any help would be greatly appreciated! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions