Listening to any packet under `PacketType.Configuration.Server` causes client to hang forever when joining
Saghetti0 opened this issue ยท 3 comments
- 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.
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! ๐
try the latest dev build (https://ci.dmulloy2.net/job/ProtocolLib). we just made some big improvements to the underlying listening code
This test was ran on build 704 (check version info), unfortunately the bug is still present
@Ingrim4 any ideas?