diff --git a/api/src/main/java/net/draycia/carbon/api/channels/ChatChannel.java b/api/src/main/java/net/draycia/carbon/api/channels/ChatChannel.java index 167f0892a..b8b171e92 100644 --- a/api/src/main/java/net/draycia/carbon/api/channels/ChatChannel.java +++ b/api/src/main/java/net/draycia/carbon/api/channels/ChatChannel.java @@ -58,7 +58,9 @@ default List recipients(final CarbonPlayer sender) { } /** - * Returns a list of all recipients that will receive messages from the sender. + * Returns the {@link RecipientsResolver} for this channel. The return value is not cached, + * and {@link ChannelPermissions#speechPermitted(CarbonPlayer)} is checked before + * invoking this method. * * @return the recipients resolver * @since 3.0.0 diff --git a/api/src/main/java/net/draycia/carbon/api/channels/RecipientsResolver.java b/api/src/main/java/net/draycia/carbon/api/channels/RecipientsResolver.java index 2b30db82f..f998f4f26 100644 --- a/api/src/main/java/net/draycia/carbon/api/channels/RecipientsResolver.java +++ b/api/src/main/java/net/draycia/carbon/api/channels/RecipientsResolver.java @@ -122,7 +122,7 @@ private Builder(final CarbonServer server) { /** * Includes online players matching the predicate in the resolved recipients. Adding multiple predicates - * will include players matching any one of the predicate. + * will include players matching any one of the predicates. * * @param filter player filter * @return this builder diff --git a/common/src/main/java/net/draycia/carbon/common/listeners/ChatListenerInternal.java b/common/src/main/java/net/draycia/carbon/common/listeners/ChatListenerInternal.java index b1514743b..a894abfca 100644 --- a/common/src/main/java/net/draycia/carbon/common/listeners/ChatListenerInternal.java +++ b/common/src/main/java/net/draycia/carbon/common/listeners/ChatListenerInternal.java @@ -117,7 +117,7 @@ protected ChatListenerInternal( final List renderers = new ArrayList<>(); renderers.add(KeyedRenderer.keyedRenderer(Key.key("carbon", "default"), channel)); - final List recipients = channel.recipients(sender); + final List recipients = channel.recipientsResolver().recipients(sender); final var chatEvent = new CarbonChatEventImpl(sender, message, recipients, renderers, channel, signedMessage); diff --git a/common/src/main/java/net/draycia/carbon/common/messaging/CarbonChatPacketHandler.java b/common/src/main/java/net/draycia/carbon/common/messaging/CarbonChatPacketHandler.java index 63cae5cb2..7f734680b 100644 --- a/common/src/main/java/net/draycia/carbon/common/messaging/CarbonChatPacketHandler.java +++ b/common/src/main/java/net/draycia/carbon/common/messaging/CarbonChatPacketHandler.java @@ -124,7 +124,7 @@ private boolean handleMessagePacket(final ChatMessagePacket messagePacket) { final List renderers = new ArrayList<>(); - final List recipients = channel.recipients(sender); + final List recipients = channel.recipientsResolver().recipients(sender); final CarbonChatEventImpl chatEvent = new CarbonChatEventImpl(sender, messagePacket.message(), recipients, renderers, channel, null, false); this.events.emit(chatEvent);