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:
@@ -34,7 +34,8 @@ object Versions {
|
||||
const val nettyVersion = "4.1.49.Final"
|
||||
const val snakeyamlVersion = "1.28"
|
||||
// TODO move to cloud release once those have 1.20.5 support
|
||||
const val cloudVersion = "2.0.0-20240503.183307-62" // for cloud-minecraft
|
||||
const val cloudVersion = "2.0.0-beta.7" // for cloud-minecraft
|
||||
const val cloudCore = "2.0.0-rc.1"
|
||||
const val bstatsVersion = "3.0.2"
|
||||
|
||||
const val javaWebsocketVersion = "1.5.2"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@ dependencies {
|
||||
api("com.nukkitx.fastutil", "fastutil-short-object-maps", Versions.fastutilVersion)
|
||||
api("com.nukkitx.fastutil", "fastutil-int-object-maps", Versions.fastutilVersion)
|
||||
api("org.java-websocket", "Java-WebSocket", Versions.javaWebsocketVersion)
|
||||
// TODO move to cloud release
|
||||
api("org.incendo", "cloud-core", "2.0.0-20240503.181645-64")
|
||||
api("org.incendo", "cloud-core", Versions.cloudCore)
|
||||
api("org.bstats", "bstats-base", Versions.bstatsVersion)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user