Update Adventure to 4.11.0 and implement ComponentLogger (#7937)

This commit is contained in:
Josh Roy 2022-06-12 17:07:40 -04:00 committed by GitHub
parent 3690440aaa
commit 90050ffd54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 111 additions and 33 deletions

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 f0423df165bf7d0f3fad21d26b64f31ba3e6aeee..6f31679c2944fae3b37847c683abb0d2e5791449 100644
index f0423df165bf7d0f3fad21d26b64f31ba3e6aeee..7b8196db1fd1e283dc9ef71e3fe5137cc5920ba9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,17 +8,36 @@ java {
@@ -8,17 +8,37 @@ java {
withJavadocJar()
}
+val adventureVersion = "4.10.1"
+val adventureVersion = "4.11.0"
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+ attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@ -45,10 +45,11 @@ index f0423df165bf7d0f3fad21d26b64f31ba3e6aeee..6f31679c2944fae3b37847c683abb0d2
+ apiAndDocs("net.kyori:adventure-text-serializer-gson")
+ apiAndDocs("net.kyori:adventure-text-serializer-legacy")
+ apiAndDocs("net.kyori:adventure-text-serializer-plain")
+ apiAndDocs("net.kyori:adventure-text-logger-slf4j")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
@@ -77,9 +96,24 @@ tasks.withType<Javadoc> {
@@ -77,9 +97,24 @@ tasks.withType<Javadoc> {
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
@ -3996,6 +3997,24 @@ index 228421154913116069c20323afb519bdde2134df..26791db3c267670d5782f1d2b67ff7d5
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..b37938745f916b5f0111b07b1a1c97527f026e9d 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -179,6 +179,13 @@ public interface Plugin extends TabExecutor {
@NotNull
public Logger getLogger();
+ // Paper start - Adventure component logger
+ @NotNull
+ default net.kyori.adventure.text.logger.slf4j.ComponentLogger getComponentLogger() {
+ return net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(getLogger().getName());
+ }
+ // Paper end
+
/**
* Returns the name of the plugin.
* <p>
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c5569a244 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java