Revxrsal / Lamp

A powerful, extendable, flexible yet simple to use commands annotation framework.
MIT License
171 stars 33 forks source link

fix: support OfflinePlayer resolver for freshly-joined players #71

Closed nkomarn closed 9 months ago

nkomarn commented 11 months ago

currently, if the referenced player is online but has only just joined the server (their first known session), the resolver will fail and throw an InvalidPlayerException, despite the player being online.

to combat this, we can use the "first played" timestamp to check if the player has ever existed on the server.

SrBlecaute01 commented 11 months ago

A fix has already been made for this issue https://github.com/Revxrsal/Lamp/pull/54, but there is another way to solve the problem. However, I think this method does more checks on the part of CraftOfflinePlayer

Revxrsal commented 9 months ago

I've implemented this in https://github.com/Revxrsal/Lamp/commit/09dc9349dc6b3909b12a975979a51bc0600ffb18. Thanks!