Closed onebeastchris closed 4 months ago
Yes, because it is only set in the ClientSettings packet which has not been sent by the client at this point.
Not sure what you expect bungee to do about this
Ah, would be neat to see the method being marked as Nullable then - otherwise, it's easy to assume it being NonNull :)
Or otherwise specify it in for example the comment, which is also the case on other methods like: getReconnectServer, getUniqueId and getViewDistance
BungeeCord has no consistent nullability annotations.
At most, BungeeCord does have a few @NonNull
annotations.
With Bungee re-using the same interfaces & Objects during the connectino establishment, for many getters any kind of nullability annotation seems unfitting.
Bungeecord version
git:BungeeCord-Bootstrap:1.20-R0.3-SNAPSHOT:18eae8a:1842
Server version
1.20 Spigot
Client version
1.20
Bungeecord plugins
Floodgate (local build, with the event handler code provided below)
The bug
Hey! I noticed that the
getLocale()
method of the ProxiedPlayer can return null during the PostLoginEvent:Calling that e.g. when commands are ran, it returns the player locale as expected. Since this method is not marked as nullable, it would be expected that the locale is non-null (as it usually is).
I've also tested this on a 1.20.6 Java client & 1.20.6 paper server; same behavior.
Log output (links)
Checking