Class MessageSender
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.sender.MessageSender
- All Implemented Interfaces:
Sender
Sends chat messages to a
Recipient.Sendable
based on the contents of a FinalMessageRecord
.
This implementation handles:
- Chat color translation using
'&'
codes - Empty or disabled messages gracefully
- Cooldown tracking via a
CooldownMap
It is typically used to deliver the main message body, rather than titles or subtitles.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageSender
(CooldownMap cooldownMap) Constructs aMessageSender
with the specified cooldown map for managing message repeat suppression. -
Method Summary
Modifier and TypeMethodDescriptionvoid
send
(Recipient.Sendable recipient, FinalMessageRecord messageRecord) Sends a chat message to the specified recipient if the message is enabled and contains content.
-
Constructor Details
-
MessageSender
Constructs aMessageSender
with the specified cooldown map for managing message repeat suppression.- Parameters:
cooldownMap
- the cooldown map used to track and store message cooldowns
-
-
Method Details
-
send
Sends a chat message to the specified recipient if the message is enabled and contains content. Cooldowns are recorded after sending.The message text is color-translated using
'&'
codes.
-