From 1aab1268c40d0405653b512262433af7788583b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 17:08:43 +0000 Subject: [PATCH 1/2] chore(deps): Update dependency com.puppycrawl.tools:checkstyle to v10.20.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a7e75c5cb..43db3ae1d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ version = "1.0" [versions] autoService = "1.1.1" -checkstyle = "10.18.2" +checkstyle = "10.20.0" errorprone = "2.31.0" examination = "1.3.0" guava = "33.3.1-jre" From a0a7060294d5466f3608a3f47104241a69cd5c46 Mon Sep 17 00:00:00 2001 From: zml Date: Sat, 2 Nov 2024 20:24:55 -0700 Subject: [PATCH 2/2] chore: resolve checkstyle violations --- api/src/main/java/net/kyori/adventure/audience/Audience.java | 5 +++++ api/src/main/java/net/kyori/adventure/bossbar/BossBar.java | 1 + .../net/kyori/adventure/text/minimessage/MiniMessage.java | 2 ++ 3 files changed, 8 insertions(+) diff --git a/api/src/main/java/net/kyori/adventure/audience/Audience.java b/api/src/main/java/net/kyori/adventure/audience/Audience.java index 3abc6bed9..394fbce5f 100644 --- a/api/src/main/java/net/kyori/adventure/audience/Audience.java +++ b/api/src/main/java/net/kyori/adventure/audience/Audience.java @@ -61,12 +61,14 @@ * command sender, console, or otherwise who can receive text, titles, * boss bars, and other Minecraft media. It is also designed for a group of * receivers such as a team, server, world, or permission.

+ * *

In the past, Minecraft platforms have typically reserved methods such as * showTitle for a Player interface. While this is good * textbook object-oriented design, it presents two key drawbacks: 1) there * is no abstraction for groups of players, such as a Server or a * Team and 2) it add boilerplate for handling special cases like * console or command senders.

+ * *

Consider the use-case of sending a message and title to every player on a * server, and also sending a message to console. Without an Audience, * the code might look like this:

@@ -77,6 +79,7 @@ * player.showTitle(...); * } * server.getConsole().sendMessage(...); + * *

Now, if Server implemented Audience, its unified interface * would allow users to easily send media without if-guarding console or * iterating through the list of players:

@@ -84,10 +87,12 @@ * Server server; * server.sendMessage(...); // Sends a message to players and console * server.showTitle(...); // Shows a title to players, silently ignored by console + * *

When an Audience is unable to perform an operation, such as sending * a boss bar to console, it will silently fail, without logging. This * requirement allows users to easily send media to a group of * Audiences without checking each for compatibility.

+ * *

While the scope of Audience may be expanded in the future to support * new Minecraft media such as the player list, its interface will remain stateless * and any new methods will be stubbed by default.

diff --git a/api/src/main/java/net/kyori/adventure/bossbar/BossBar.java b/api/src/main/java/net/kyori/adventure/bossbar/BossBar.java index 3528ba713..68e8fbf36 100644 --- a/api/src/main/java/net/kyori/adventure/bossbar/BossBar.java +++ b/api/src/main/java/net/kyori/adventure/bossbar/BossBar.java @@ -36,6 +36,7 @@ /** * Represents an in-game bossbar which can be shown to the client. + * *

A bossbar consists of:

*
*
name
diff --git a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessage.java b/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessage.java index ec3504d81..317e258cc 100644 --- a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessage.java +++ b/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessage.java @@ -362,6 +362,7 @@ interface Builder extends AbstractBuilder { /** * Specify a function that takes the component at the end of the parser process. + * *

By default, this compacts the resulting component with {@link Component#compact()}.

* * @param postProcessor method run at the end of parsing @@ -372,6 +373,7 @@ interface Builder extends AbstractBuilder { /** * Specify a function that takes the string at the start of the parser process. + * *

By default, this does absolutely nothing.

* * @param preProcessor method run at the start of parsing