From 81c1533ee2c7952d8644b8d2c5d1691195395ad4 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 9 Apr 2020 17:21:51 +0100 Subject: [PATCH] en_us user now gets a chat message if the locale isnt already loaded --- .../connector/network/session/GeyserSession.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index 36e3a5b0d..9761f92e2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -254,11 +254,17 @@ public class GeyserSession implements CommandSender { playerEntity.setUuid(protocol.getProfile().getId()); playerEntity.setUsername(protocol.getProfile().getName()); - // Should probably let the user know if there locale is - // en_us that it might take time to download it + String locale = clientData.getLanguageCode(); + + // Let the user know there locale may take some time to download + // as it has to be extracted from a JAR + if (locale.toLowerCase().equals("en_us") && !LocaleUtils.LOCALE_MAPPINGS.containsKey("en_us")) { + connector.getLogger().info("warning user"); + sendMessage("Downloading your locale (en_us) this may take some time"); + } // Download and load the language for the player - LocaleUtils.downloadAndLoadLocale(clientData.getLanguageCode()); + LocaleUtils.downloadAndLoadLocale(locale); } @Override