From cdcf83267395765cb41ddc2295cacec76b5bedb5 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 25 Dec 2023 02:51:44 -0800 Subject: [PATCH] Update to adventure 4.15 (#10045) --- patches/api/Adventure.patch | 95 +++++++++-- ...low-plugins-to-use-SLF4J-for-logging.patch | 2 +- patches/api/Complete-resource-pack-API.patch | 27 ++-- .../server/Add-PlayerKickEvent-causes.patch | 4 +- patches/server/Adventure.patch | 149 +++++++++++++++--- patches/server/Brand-support.patch | 2 +- .../server/Complete-resource-pack-API.patch | 20 +-- patches/server/Temp-adventure-update.patch | 32 ---- ...oleAppender-for-console-improvements.patch | 2 +- ...rt-serverside-behavior-of-keepalives.patch | 1 + 10 files changed, 232 insertions(+), 102 deletions(-) delete mode 100644 patches/server/Temp-adventure-update.patch diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index acb17cdd86..11a1296aa8 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 val annotationsVersion = "24.0.1" val bungeeCordChatVersion = "1.20-R0.1" -+val adventureVersion = "4.14.0" ++val adventureVersion = "4.15.0" +val apiAndDocs: Configuration by configurations.creating { + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) @@ -2481,11 +2481,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ @Deprecated public void setTexturePack(@NotNull String url); +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @throws IllegalArgumentException Thrown if the URL is null. + * @throws IllegalArgumentException Thrown if the URL is too long. The + * length restriction is an implementation specific arbitrary value. ++ * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} + */ ++ @Deprecated // Paper - adventure + public void setResourcePack(@NotNull String url); + + /** @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * pack correctly. * * -+ * @deprecated in favour of {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)} ++ * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} * @param url The URL from which the client will download the resource * pack. The string must contain only US-ASCII characters and should * be encoded as per RFC 1738. @@ -2498,10 +2508,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * {@link PlayerResourcePackStatusEvent} to figure out whether or not + * the player loaded the pack! + *
  • To remove a resource pack you can use +- * {@link #removeResourcePack(UUID)} or {@link #removeResourcePacks()}. ++ * {@link #removeResourcePacks(UUID, UUID...)} or {@link #clearResourcePacks()}. + *
  • The request is sent with empty string as the hash when the hash is + * not provided. This might result in newer versions not loading the * pack correctly. * * -+ * @deprecated in favour of {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)} ++ * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} * @param url The URL from which the client will download the resource * pack. The string must contain only US-ASCII characters and should * be encoded as per RFC 1738. @@ -2534,6 +2551,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * case this method will have no affect on them. Use the + * {@link PlayerResourcePackStatusEvent} to figure out whether or not + * the player loaded the pack! ++ *
  • To remove a resource pack you can use ++ * {@link #removeResourcePacks(UUID, UUID...)} or {@link #clearResourcePacks()}. + *
  • The request is sent with empty string as the hash when the hash is + * not provided. This might result in newer versions not loading the + * pack correctly. @@ -2551,6 +2570,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * length restriction is an implementation specific arbitrary value. + * @throws IllegalArgumentException Thrown if the hash is not 20 bytes + * long. ++ * @see #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest) + */ + default void setResourcePack(final @NotNull String url, final byte @Nullable [] hash, final net.kyori.adventure.text.@Nullable Component prompt) { + this.setResourcePack(url, hash, prompt, false); @@ -2561,16 +2581,38 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * Request that the player's client download and switch resource packs. *

    @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * {@link PlayerResourcePackStatusEvent} to figure out whether or not + * the player loaded the pack! + *

  • To remove a resource pack you can use +- * {@link #removeResourcePack(UUID)} or {@link #removeResourcePacks()}. ++ * {@link #removeResourcePacks(UUID, UUID...)} or {@link #clearResourcePacks()}. + *
  • The request is sent with empty string as the hash when the hash is + * not provided. This might result in newer versions not loading the * pack correctly. - * - * -+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component, boolean)} - * @param url The URL from which the client will download the resource - * pack. The string must contain only US-ASCII characters and should - * be encoded as per RFC 1738. @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * length restriction is an implementation specific arbitrary value. * @throws IllegalArgumentException Thrown if the hash is not 20 bytes * long. ++ * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} + */ ++ @Deprecated // Paper - adventure + public void setResourcePack(@NotNull String url, @Nullable byte[] hash, boolean force); + + /** +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * {@link PlayerResourcePackStatusEvent} to figure out whether or not + * the player loaded the pack! + *
  • To remove a resource pack you can use +- * {@link #removeResourcePack(UUID)} or {@link #removeResourcePacks()}. ++ * {@link #removeResourcePacks(UUID, UUID...)} or {@link #clearResourcePacks()}. + *
  • The request is sent with empty string as the hash when the hash is + * not provided. This might result in newer versions not loading the + * pack correctly. +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * length restriction is an implementation specific arbitrary value. + * @throws IllegalArgumentException Thrown if the hash is not 20 bytes + * long. ++ * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} */ + @Deprecated // Paper public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force); @@ -2588,8 +2630,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * perform a file size check against the response content to determine if + * the resource pack has changed and needs to be downloaded again. When + * this request is sent for the very first time from a given server, the -+ * client will first display a confirmation GUI to the player before -+ * proceeding with the download. ++ * client will first display a confirmation GUI with a custom prompt ++ * to the player before proceeding with the download. + *

    + * Notes: + *