diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index efd8f1bed8..5ccde0310d 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -213,6 +213,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +import java.util.Set; @@ -222,6 +223,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +/** + * An abstract implementation of a chat event, handling shared logic. + */ ++@ApiStatus.NonExtendable +public abstract class AbstractChatEvent extends PlayerEvent implements Cancellable { + private final Set viewers; + private final Component originalMessage; @@ -242,15 +244,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + /** + * Gets a set of {@link Audience audiences} that this chat message will be displayed to. + * -+ *

The set returned is not guaranteed to be mutable and may auto-populate -+ * on access. Any listener accessing the returned set should be aware that ++ *

The set returned may auto-populate on access. Any listener accessing the returned set should be aware that + * it may reduce performance for a lazy set implementation.

+ * -+ *

Listeners should be aware that modifying the list may throw {@link -+ * UnsupportedOperationException} if the event caller provides an -+ * unmodifiable set.

-+ * -+ * @return a set of {@link Audience audiences} who will receive the chat message ++ * @return a mutable set of {@link Audience audiences} who will receive the chat message + */ + @NotNull + public final Set viewers() { @@ -504,6 +501,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.kyori.adventure.text.Component; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +/** @@ -512,6 +510,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +public final class AsyncChatEvent extends AbstractChatEvent { + private static final HandlerList HANDLERS = new HandlerList(); + ++ /** ++ * @param viewers A mutable set of viewers ++ */ ++ @ApiStatus.Internal + public AsyncChatEvent(final boolean async, final @NotNull Player player, final @NotNull Set viewers, final @NotNull ChatRenderer renderer, final @NotNull Component message, final @NotNull Component originalMessage, final @NotNull SignedMessage signedMessage) { + super(async, player, viewers, renderer, message, originalMessage, signedMessage); + } @@ -543,6 +545,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import org.bukkit.Warning; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +/** @@ -555,6 +558,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +public final class ChatEvent extends AbstractChatEvent { + private static final HandlerList HANDLERS = new HandlerList(); + ++ /** ++ * @param viewers A mutable set of viewers ++ */ ++ @ApiStatus.Internal + public ChatEvent(final @NotNull Player player, final @NotNull Set viewers, final @NotNull ChatRenderer renderer, final @NotNull Component message, final @NotNull Component originalMessage, final @NotNull SignedMessage signedMessage) { + super(false, player, viewers, renderer, message, originalMessage, signedMessage); + }