From 326abeaab5fdb9074fbc01fe1ba8b8e8f5ee259a Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:12:17 +0100 Subject: [PATCH] Deprecate ChatVisibility#UNKNOWN (#11683) --- patches/api/Add-Player-Client-Options-API.patch | 6 ++++++ patches/server/Implement-Player-Client-Options-API.patch | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/patches/api/Add-Player-Client-Options-API.patch b/patches/api/Add-Player-Client-Options-API.patch index 7f3518c2aa..f7d3de95c7 100644 --- a/patches/api/Add-Player-Client-Options-API.patch +++ b/patches/api/Add-Player-Client-Options-API.patch @@ -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 NAMES = Index.create(ChatVisibility.class, chatVisibility -> chatVisibility.name); diff --git a/patches/server/Implement-Player-Client-Options-API.patch b/patches/server/Implement-Player-Client-Options-API.patch index 94cf30a03c..0616d0ff64 100644 --- a/patches/server/Implement-Player-Client-Options-API.patch +++ b/patches/server/Implement-Player-Client-Options-API.patch @@ -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) {