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:
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:
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
* Audience
s 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.
A bossbar consists of:
*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 AbstractBuilderBy default, this does absolutely nothing.
* * @param preProcessor method run at the start of parsing