ProtocolLib may cause breaking packet reordering
- [X] This issue is not solved in a development build
Describe the bug Spawning a player relies on its player info being sent before its spawn packet. If the client is told to spawn a player with missing player info, it won't spawn it at all. As a consequence and in case a listener for the PlayerInfo packet is added to ProtocolLib, the NPC will not spawn at all:
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(MBedwars.plugin, Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
}
});
On the hand if listening to both packets, the NPC will spawn just fine:
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(MBedwars.plugin, Server.PLAYER_INFO, Server.NAMED_ENTITY_SPAWN) {
@Override
public void onPacketSending(PacketEvent event) {
}
});
To Reproduce Steps to reproduce the behavior: Have a plugin that spawns NPCs using packets with no delay between its PlayerInfo and NamedEntitySpawn packet. Add a listener to ProtocolLib for only the PlayerInfo packet.
Version Info https://pastebin.com/wJMZtrz1
Potentially related to https://github.com/dmulloy2/ProtocolLib/issues/2948
Add ListenerOptions.ASYNC to adapter
Add ListenerOptions.ASYNC to adapter
You want me to locate and fix every plugin existing that is listening wrongfully to that packet?