From e4d8c47ebf0635a2151d78d9fe3de122d6dfcbc7 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Wed, 6 Oct 2021 01:05:39 -0700 Subject: [PATCH] Update adventure and fix command perm serialization NPE (#6729) --- patches/api/0007-Adventure.patch | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/patches/api/0007-Adventure.patch b/patches/api/0007-Adventure.patch index bb362b3ea6..65b410bcb4 100644 --- a/patches/api/0007-Adventure.patch +++ b/patches/api/0007-Adventure.patch @@ -7,14 +7,14 @@ Co-authored-by: zml Co-authored-by: Jake Potrebic diff --git a/build.gradle.kts b/build.gradle.kts -index 3a395a44ff50a77895341bbbfb8c81deede41b8b..6ebea1d9fafb08ede7e37dfe1b145a676c7aaaf9 100644 +index 3a395a44ff50a77895341bbbfb8c81deede41b8b..0a49a70a8f70e9b0af1eb5cff10884b98f86da7d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,19 @@ java { withJavadocJar() } -+val adventureVersion = "4.9.1" ++val adventureVersion = "4.9.2" +val apiAndDocs by configurations.creating { + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) @@ -1221,7 +1221,7 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33 /** diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index 03bdc1622791e1206406c87065978688d602e39e..96067ea484eab10bc2be35656481185a67cbcad5 100644 +index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -32,7 +32,7 @@ public abstract class Command { @@ -1258,7 +1258,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..96067ea484eab10bc2be35656481185a + @Deprecated // Paper public String getPermissionMessage() { - return permissionMessage; -+ return io.papermc.paper.text.PaperComponents.legacySectionSerializer().serialize(permissionMessage); // Paper ++ return io.papermc.paper.text.PaperComponents.legacySectionSerializer().serializeOrNull(permissionMessage); // Paper } /** @@ -1276,15 +1276,25 @@ index 03bdc1622791e1206406c87065978688d602e39e..96067ea484eab10bc2be35656481185a return this; } -@@ -398,6 +402,15 @@ public abstract class Command { +@@ -398,6 +402,25 @@ public abstract class Command { this.usageMessage = (usage == null) ? "" : usage; return this; } + // Paper start ++ /** ++ * Gets the permission message. ++ * ++ * @return the permission message ++ */ + public @Nullable net.kyori.adventure.text.Component permissionMessage() { + return this.permissionMessage; + } + ++ /** ++ * Sets the permission message. ++ * ++ * @param permissionMessage the permission message ++ */ + public void permissionMessage(@Nullable net.kyori.adventure.text.Component permissionMessage) { + this.permissionMessage = permissionMessage; + }