mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Deal with getLocale being nullable during login on BungeeCord (#511)
* Temporary fix for https://github.com/GeyserMC/Floodgate/issues/510, bump cloud to rc candidate * apparently it is supposed to be nullable. okay then.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
package org.geysermc.floodgate.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
@@ -63,7 +64,8 @@ public final class BungeeCommandUtil extends CommandUtil {
|
||||
ProxiedPlayer player = (ProxiedPlayer) source;
|
||||
UUID uuid = player.getUniqueId();
|
||||
String username = player.getName();
|
||||
String locale = Utils.getLocale(player.getLocale());
|
||||
Locale playerLocale = player.getLocale(); // Is null during the PostLoginEvent, which can cause https://github.com/GeyserMC/Floodgate/issues/510
|
||||
String locale = Utils.getLocale(playerLocale != null ? playerLocale : Locale.getDefault());
|
||||
|
||||
return new PlayerAudience(uuid, username, locale, source, this, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user