java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.pipeline.senders.KyoriTitleSender
All Implemented Interfaces:
Sender

public final class KyoriTitleSender extends Object implements 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 MessageCooldownMap
See Also:
  • Constructor Details

    • KyoriTitleSender

      public KyoriTitleSender(MessageCooldownMap messageCooldownMap, net.kyori.adventure.text.minimessage.MiniMessage miniMessage, net.kyori.adventure.platform.bukkit.BukkitAudiences audiences)
      Constructs a KyoriTitleSender using the specified cooldown map.
      Parameters:
      messageCooldownMap - an instance of the message cooldown map used to prevent redundant delivery
  • Method Details

    • send

      public void send(Recipient.Sendable recipient, FinalMessageRecord messageRecord)
      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. CooldownMap state is recorded upon successful delivery.

      Specified by:
      send in interface Sender
      Parameters:
      recipient - the message recipient
      messageRecord - the message record containing the title, subtitle, and timing data