Paper
Paper copied to clipboard
Fix unnecessary player info remove packets being sent when hiding players
When CraftPlayer.unregisterEntity is given a player, it will check to see if it should send a player info remove packet. However this check is only for whether the player being unregistered has received the player list.
This check is not sufficient; when a player is hidden from a newly joining player in PlayerJoinEvent a remove packet will be sent to the joining player, even though they have not yet received the player list. This will reveal the presence of the hidden player on the server.
Changing the check to require both players to have received the player list resolves this.