GTNewHorizons / ServerUtilities

GNU Lesser General Public License v3.0
27 stars 12 forks source link

Fix crash when creating a new world #87

Closed Lyfts closed 2 months ago

Lyfts commented 2 months ago

Closes https://github.com/GTNewHorizons/ServerUtilities/issues/86

The crash was introduced in https://github.com/GTNewHorizons/ServerUtilities/pull/82 which I didn't notice as it only happens when creating a new world/a new player joining a server. The reason this happens is because PlayerEvent.NameFormat is sent prior to PlayerEvent.PlayerLoggedInEvent which means the player won't necessarily be registered yet. Switching getPlayer back to the nullable version solves it.