From ffbc8e5f27fe0fe126c10d1703335b2c7ec5fdc3 Mon Sep 17 00:00:00 2001 From: TheMode Date: Wed, 8 Sep 2021 00:54:00 +0200 Subject: [PATCH] Fix Player#getLocale Signed-off-by: TheMode --- src/main/java/net/minestom/server/entity/Player.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index fd574b11c..02cf44763 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -2057,7 +2057,9 @@ public class Player extends LivingEntity implements CommandSender, Localizable, @Override public Locale getLocale() { - return settings.locale == null ? null : Locale.forLanguageTag(settings.locale); + final String locale = settings.locale; + if (locale == null) return null; + return Locale.forLanguageTag(locale.replace("_", "-")); } /**