Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Order of events with PlayerQuitEvent

Open PedroMPagani opened this issue 1 year ago • 0 comments

Expected behavior

I think it's expected that after the PlayerQuitEvent for the player to not tick anymore, which could potentially create issues with plugins that rely on the data state of the player in the context of the player quit. Making it impossible for the player to naturally take "damage" from sources like fire tick etc.

Observed/Actual behavior

Currently, I believe this is a Spigot tick, not sure, the code runs the player quit alongside a disconnect with the reason, and ticks the player after this event. meaning if any plugin relies on .isDead(), or other sorts of data that changed exactly after the context of player quit, would be basically an outdated data.

Steps/models to reproduce

It's in the code base, call player quit, then tick the player. This causes an issue, for example if a plugin relies on .getINventory(), and on the .doTick() the player dies, takes damage, the plugin would be having outdated data, it's at least an understanding that the player quit is basically saying "nothing will further happen to this user"

The code that causes the issue: image

I know this technically was a spigot addon, but thought I could just report and maybe paper decides, or maybe even has an explanation as to why this wouldn't change if so? :)

Plugin and Datapack List

0

Paper version

latest commit, it's just to fork and see the method.

Other

No response

PedroMPagani avatar Aug 18 '24 13:08 PedroMPagani