mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Fix NotNull locales (#10216)
Two methods returning locales are annotated @NotNull, despite being able to return null
This commit is contained in:
parent
4f9f09bb9b
commit
6591c39509
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2826,7 +2826,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.language = clientOptions.language();
|
||||
+ this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // Paper
|
||||
+ this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
|
||||
this.requestedViewDistance = clientOptions.viewDistance();
|
||||
this.chatVisibility = clientOptions.chatVisibility();
|
||||
this.canChatColor = clientOptions.chatColors();
|
||||
|
@ -133,7 +133,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public void updateOptionsNoEvents(ClientInformation clientOptions) {
|
||||
+ // Paper end
|
||||
this.language = clientOptions.language();
|
||||
this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // Paper
|
||||
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
|
||||
this.requestedViewDistance = clientOptions.viewDistance();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
Loading…
Reference in New Issue
Block a user