Deprecate ChatVisibility#UNKNOWN (#11683)

This commit is contained in:
Lulu13022002 2024-11-29 17:12:17 +01:00
parent 736c78c71e
commit 326abeaab5
2 changed files with 7 additions and 1 deletions

View file

@ -44,6 +44,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ FULL("full"),
+ SYSTEM("system"),
+ HIDDEN("hidden"),
+ /**
+ * @deprecated no longer used anymore since 1.15.2, the value fallback
+ * to the default value of the setting when unknown on the server.
+ * In this case {@link #FULL} will be returned.
+ */
+ @Deprecated(since = "1.15.2", forRemoval = true)
+ UNKNOWN("unknown");
+
+ public static final Index<String, ChatVisibility> NAMES = Index.create(ChatVisibility.class, chatVisibility -> chatVisibility.name);

View file

@ -148,7 +148,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } else if (com.destroystokyo.paper.ClientOption.CHAT_COLORS_ENABLED == type) {
+ return type.getType().cast(this.getHandle().canChatInColor());
+ } else if (com.destroystokyo.paper.ClientOption.CHAT_VISIBILITY == type) {
+ return type.getType().cast(this.getHandle().getChatVisibility() == null ? com.destroystokyo.paper.ClientOption.ChatVisibility.UNKNOWN : com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(this.getHandle().getChatVisibility().name()));
+ return type.getType().cast(com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(this.getHandle().getChatVisibility().name()));
+ } else if (com.destroystokyo.paper.ClientOption.LOCALE == type) {
+ return type.getType().cast(this.getLocale());
+ } else if (com.destroystokyo.paper.ClientOption.MAIN_HAND == type) {