Class MessageManager

java.lang.Object
com.booksaw.betterTeams.message.MessageManager

public class MessageManager extends Object
Used to control all communications to the user
Author:
booksaw
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addBackupMessages(org.bukkit.configuration.file.YamlConfiguration file)
     
    static void
    addMessages(@NotNull String lang)
     
     
    static @NotNull org.bukkit.configuration.file.FileConfiguration
     
    static File
     
    static String
     
     
    static @NotNull String
    getMessage(String reference)
     
    static @NotNull String
    getMessage(String reference, Object... replacements)
    This is used to get the message from the provided location in the Configuration file, this does not add a prefix to the message
    static @NotNull String
    getMessage(org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static String
     
    static net.kyori.adventure.text.Component
     
    static void
     
    static void
    sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> senders, String message)
     
    static void
    sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String message, boolean doPrefix)
    Used when sending a raw message to a group of command senders.
    static void
    sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message)
     
    static void
    sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
     
    static void
    sendFullMessage(org.bukkit.command.CommandSender sender, String message)
    Used when you are sending a user a message instead of a message loaded from a file
    static void
    sendFullMessage(org.bukkit.command.CommandSender recipient, String message, boolean doPrefix)
    Used when you are sending a user a message instead of a message loaded from a file
    static void
    sendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message)
     
    static void
    sendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
    Sends a full Component message to the given CommandSender
    static void
    sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message)
     
    static void
    sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix)
     
    static void
    sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message)
     
    static void
    sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
     
    static void
    sendFullSubTitle(org.bukkit.entity.Player recipient, String message)
     
    static void
    sendFullSubTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix)
     
    static void
    sendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message)
     
    static void
    sendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
     
    static void
    sendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message)
     
    static void
    sendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix)
     
    static void
    sendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message)
     
    static void
    sendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
     
    static void
    sendFullTitle(org.bukkit.entity.Player recipient, String message)
     
    static void
    sendFullTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix)
     
    static void
    sendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message)
     
    static void
    sendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
     
    static void
    sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle)
     
    static void
    sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub)
     
    static void
    sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle)
     
    static void
    sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub)
     
    static void
    sendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle)
     
    static void
    sendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub)
     
    static void
    sendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle)
     
    static void
    sendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub)
     
    static void
    sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String reference, Object... replacements)
     
    static void
    sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static void
    sendMessage(org.bukkit.command.CommandSender recipient, boolean doPrefix, String reference, Object... replacements)
    Used to send a (formatted) message to the specified user
    static void
    sendMessage(org.bukkit.command.CommandSender recipient, String reference, Object... replacements)
     
    static void
    sendMessage(org.bukkit.command.CommandSender recipient, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendMessage(org.bukkit.command.CommandSender recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static void
    sendSubTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendSubTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements)
     
    static void
    sendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static void
    sendSubTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements)
    Used to send a (formatted) subtitle to the specified user
    static void
    sendSubTitle(org.bukkit.entity.Player recipient, String reference, Object... replacements)
     
    static void
    sendSubTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    Used to send a (formatted) subtitle to the specified user
    static void
    sendSubTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static void
    sendTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements)
     
    static void
    sendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
     
    static void
    sendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
     
    static void
    sendTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements)
    Used to send a (formatted) title to the specified user
    static void
    sendTitle(org.bukkit.entity.Player recipient, String reference, Object... replacements)
     
    static void
    sendTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    Used to send a (formatted) title to the specified user
    static void
    sendTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacement)
     
    static void
    setupMessageSender(net.kyori.adventure.platform.bukkit.BukkitAudiences audiences)
    Used to instantiate a new MessageSender.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • addMessages

      public static void addMessages(@NotNull @NotNull String lang)
    • setupMessageSender

      @Internal public static void setupMessageSender(net.kyori.adventure.platform.bukkit.BukkitAudiences audiences)
      Used to instantiate a new MessageSender.

      Warning: This is not API, so it should never be used outside BetterTeams' package

    • addBackupMessages

      public static void addBackupMessages(org.bukkit.configuration.file.YamlConfiguration file)
    • reload

      public static void reload()
    • getLanguage

      public static String getLanguage()
    • getPrefix

      public static String getPrefix()
    • getPrefixComponent

      public static net.kyori.adventure.text.Component getPrefixComponent()
    • getMessage

      @NotNull public static @NotNull String getMessage(String reference)
    • getMessage

      @NotNull public static @NotNull String getMessage(String reference, Object... replacements)
      This is used to get the message from the provided location in the Configuration file, this does not add a prefix to the message
      Parameters:
      reference - the reference for the message
      replacements - the replacements for the {n} placeholders ( {0}, {1}, {2}, ... )
      Returns:
      the message (without prefix)
    • getMessage

      @NotNull public static @NotNull String getMessage(org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(org.bukkit.command.CommandSender recipient, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(org.bukkit.command.CommandSender recipient, boolean doPrefix, String reference, Object... replacements)
      Used to send a (formatted) message to the specified user
      Parameters:
      recipient - the commandSender which the message should be sent to
      doPrefix - if the message should have prefix
      reference - the reference for the message
      replacements - the value that the placeholder should be replaced with
    • sendMessage

      public static void sendMessage(org.bukkit.command.CommandSender recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(org.bukkit.command.CommandSender recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, boolean doPrefix, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendMessage

      public static void sendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    • sendFullMessage

      public static void sendFullMessage(org.bukkit.command.CommandSender sender, String message)
      Used when you are sending a user a message instead of a message loaded from a file
      Parameters:
      sender - the player who sent the command
      message - the message to send to that user
    • sendFullMessage

      public static void sendFullMessage(org.bukkit.command.CommandSender recipient, String message, boolean doPrefix)
      Used when you are sending a user a message instead of a message loaded from a file
      Parameters:
      recipient - The player who sent the command
      message - The message to send to that user
      doPrefix - If a prefix should be applied
    • sendFullMessage

      public static void sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> senders, String message)
    • sendFullMessage

      public static void sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String message, boolean doPrefix)
      Used when sending a raw message to a group of command senders.
      Parameters:
      recipients -
      message -
      doPrefix -
    • sendFullMessage

      public static void sendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message)
    • sendFullMessage

      public static void sendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
      Sends a full Component message to the given CommandSender
      Parameters:
      recipient - the target to send the message to
      message - the Adventure Component to send
    • sendFullMessage

      public static void sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message)
    • sendFullMessage

      public static void sendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player recipient, String reference, Object... replacements)
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements)
      Used to send a (formatted) title to the specified user
      Parameters:
      recipient - the player which the message should be sent to
      doPrefix - if the message should include the prefix or not
      reference - the reference for the message
      replacements - the value that the placeholder should be replaced with
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacement)
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
      Used to send a (formatted) title to the specified user
      Parameters:
      recipient - the player which the message should be sent to
      player - the player to format this message around
      doPrefix - if the message should include the prefix or not
      reference - the reference for the message
      replacements - the value that the placeholder should be replaced with
    • sendTitle

      public static void sendTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements)
    • sendTitle

      public static void sendTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements)
    • sendTitle

      public static void sendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendTitle

      public static void sendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    • sendFullTitle

      public static void sendFullTitle(org.bukkit.entity.Player recipient, String message)
    • sendFullTitle

      public static void sendFullTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix)
    • sendFullTitle

      public static void sendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message)
    • sendFullTitle

      public static void sendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix)
    • sendFullTitle

      public static void sendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message)
    • sendFullTitle

      public static void sendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
    • sendFullTitle

      public static void sendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message)
    • sendFullTitle

      public static void sendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
    • sendSubTitle

      public static void sendSubTitle(org.bukkit.entity.Player recipient, String reference, Object... replacements)
    • sendSubTitle

      public static void sendSubTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements)
      Used to send a (formatted) subtitle to the specified user
      Parameters:
      recipient - the player which the message should be sent to
      doPrefix - if the message should include the prefix or not
      reference - the reference for the message
      replacements - the value that the placeholder should be replaced with
    • sendSubTitle

      public static void sendSubTitle(org.bukkit.entity.Player recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendSubTitle

      public static void sendSubTitle(org.bukkit.entity.Player recipient, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
      Used to send a (formatted) subtitle to the specified user
      Parameters:
      recipient - the player which the message should be sent to
      player - the player to format this message around
      doPrefix - if the message should include the prefix or not
      reference - the reference for the message
      replacements - the value that the placeholder should be replaced with
    • sendSubTitle

      public static void sendSubTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements)
    • sendSubTitle

      public static void sendSubTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements)
    • sendSubTitle

      public static void sendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements)
    • sendSubTitle

      public static void sendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements)
    • sendFullSubTitle

      public static void sendFullSubTitle(org.bukkit.entity.Player recipient, String message)
    • sendFullSubTitle

      public static void sendFullSubTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix)
    • sendFullSubTitle

      public static void sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message)
    • sendFullSubTitle

      public static void sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix)
    • sendFullSubTitle

      public static void sendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message)
    • sendFullSubTitle

      public static void sendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix)
    • sendFullSubTitle

      public static void sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message)
    • sendFullSubTitle

      public static void sendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle)
    • sendFullTitleAndSub

      public static void sendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub)
    • getDefaultMessages

      @NotNull public static @NotNull org.bukkit.configuration.file.FileConfiguration getDefaultMessages()
    • getFile

      public static File getFile()
    • builder

      public static MessageConfig.MessageBuilder builder(String path)
    • getMainPluginService

      public static MessageService getMainPluginService()