Update adventure and fix command perm serialization NPE (#6729)

This commit is contained in:
Jake Potrebic 2021-10-06 01:05:39 -07:00 committed by GitHub
parent e155002b31
commit e4d8c47ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,14 +7,14 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
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;
+ }