Paper
Paper copied to clipboard
Avoid respawn desync of player metadata
Closes #8689 Avoid to desync the player metadata on respawn and world teleport Before the 1.19.3 the metadata was copied with the respawn packet but now it's not always the case (notably at the death) And since upstream doesn't recreate the player instance, the metadata aren't dirty anymore here and so aren't resend to the client later. This emulate the behavior of like if the player was recreated with the default values to avoid a total reset at the respawn packet.
Do the other synced values not need to be resent? I would think that instead what we should do here is mark all of the sync values as dirty?
The respawn packet will already do that for us in case of a world teleport. For the death all values are reset in vanilla except those i have marked as dirty here
Upstream has pushed a fix for that to update all metadata when not default, this solve the skin desync and those metadata desync (clientside) but since upstream has also a lot of desync (serverside) that happens when a player died (due to some missing metadata reset in the ServerPlayer#reset to again simulate the Player instance recreated) that brings back those desync into the client. Then there no desync at all but it's not anymore vanilla and also that send another packet when the player change of dimension with portal for no reason. So if we want to keep the upstream patch we would need to reset all the metadata on death serverside otherwise some metadata will not be reinitialized properly. Those desync are also present in this patch but aren't resend to the client so ideally we would recreate the instance for a proper fix.
Closing as upstream has fixed this and just resends everything.