Fix Player#getLocale

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-08 00:54:00 +02:00
parent 3e386a1491
commit ffbc8e5f27

View File

@ -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("_", "-"));
}
/**