Class TitleSender
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.sender.TitleSender
- All Implemented Interfaces:
Sender
Sends a title and optional subtitle to a
Player
using values from a FinalMessageRecord
.
This implementation ensures that:
- Only players receive title messages (non-player senders are ignored)
- Title and subtitle strings are validated for presence before sending
- Colors are translated using
'&'
codes - Cooldowns are applied using the provided
CooldownMap
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTitleSender
(CooldownMap cooldownMap) Constructs aTitleSender
using the specified cooldown map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
send
(Recipient.Sendable recipient, FinalMessageRecord messageRecord) Sends a title and subtitle to a player if applicable, using values from the given message record.
-
Constructor Details
-
TitleSender
Constructs aTitleSender
using the specified cooldown map.- Parameters:
cooldownMap
- an instance of the message cooldown map used to prevent redundant delivery
-
-
Method Details
-
send
Sends a title and subtitle to a player if applicable, using values from the given message record.This method checks whether the sender is a
Player
, whether the message is enabled, and whether at least one of the final title or subtitle strings is non-empty. Cooldown state is recorded upon successful delivery.
-