Fix NotNull locales (#10216)

Two methods returning locales are annotated @NotNull, despite being able
to return null
This commit is contained in:
Moulberry
2024-02-10 04:30:50 +08:00
parent 4f9f09bb9b
commit 6591c39509
3 changed files with 3 additions and 3 deletions

View File

@@ -3608,7 +3608,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public PlayerLocaleChangeEvent(@NotNull Player who, @NotNull String locale) {
super(who);
this.locale = locale;
+ this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(locale); // Paper
+ this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(locale), java.util.Locale.US); // Paper start
}
/**