Package com.booksaw.betterTeams.message
Class MessageManager
java.lang.Object
com.booksaw.betterTeams.message.MessageManager
Used to control all communications to the user
- Author:
- booksaw
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBackupMessages(org.bukkit.configuration.file.YamlConfiguration file) Used to select a file to contain backup messages in the event that the community translations are incompletestatic voidaddMessages(@NotNull ConfigManager configManager) This method is used to provide the configuration file in which all the message references are stored, this method also loads the default prefixstatic voidUsed to clear all messages from the cachestatic voidUsed to clear the current MessageSender.static org.bukkit.configuration.file.FileConfigurationstatic ConfigManagerstatic @NotNull FilegetFile()static Stringstatic @NotNull StringgetMessage(String reference) static @NotNull StringgetMessage(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 messagestatic @NotNull StringgetMessage(org.bukkit.OfflinePlayer player, String reference, Object... replacements) Used to store all loaded messagesstatic StringThis is the prefix which goes before all messages related to this pluginstatic net.kyori.adventure.text.Componentstatic voidsendFullMessage(Collection<? extends org.bukkit.command.CommandSender> senders, String message) static voidsendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String message, boolean doPrefix) Used when sending a raw message to a group of command senders.static voidsendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message) static voidsendFullMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, net.kyori.adventure.text.Component message, boolean doPrefix) static voidsendFullMessage(org.bukkit.command.CommandSender sender, String message) Used when you are sending a user a message instead of a message loaded from a filestatic voidsendFullMessage(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 filestatic voidsendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message) static voidsendFullMessage(org.bukkit.command.CommandSender recipient, net.kyori.adventure.text.Component message, boolean doPrefix) Sends a fullComponentmessage to the givenCommandSenderstatic voidsendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message) static voidsendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix) static voidsendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message) static voidsendFullSubTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix) static voidsendFullSubTitle(org.bukkit.entity.Player recipient, String message) static voidsendFullSubTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix) static voidsendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message) static voidsendFullSubTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix) static voidsendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message) static voidsendFullTitle(Collection<org.bukkit.entity.Player> recipients, String message, boolean doPrefix) static voidsendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message) static voidsendFullTitle(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component message, boolean doPrefix) static voidsendFullTitle(org.bukkit.entity.Player recipient, String message) static voidsendFullTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix) static voidsendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message) static voidsendFullTitle(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component message, boolean doPrefix) static voidsendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle) static voidsendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub) static voidsendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle) static voidsendFullTitleAndSub(Collection<org.bukkit.entity.Player> recipients, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub) static voidsendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle) static voidsendFullTitleAndSub(org.bukkit.entity.Player recipient, String title, String subTitle, boolean doPrefix, boolean doPrefixOnSub) static voidsendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle) static voidsendFullTitleAndSub(org.bukkit.entity.Player recipient, net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component subTitle, boolean doPrefix, boolean doPrefixOnSub) static voidsendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, boolean doPrefix, String reference, Object... replacements) static voidsendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, String reference, Object... replacements) static voidsendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements) static voidsendMessage(Collection<? extends org.bukkit.command.CommandSender> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static voidsendMessage(org.bukkit.command.CommandSender recipient, boolean doPrefix, String reference, Object... replacements) Used to send a (formatted) message to the specified userstatic voidsendMessage(org.bukkit.command.CommandSender recipient, String reference, Object... replacements) static voidsendMessage(org.bukkit.command.CommandSender recipient, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements) static voidsendMessage(org.bukkit.command.CommandSender recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static voidsendSubTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements) static voidsendSubTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements) static voidsendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements) static voidsendSubTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static voidsendSubTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements) Used to send a (formatted) subtitle to the specified userstatic voidsendSubTitle(org.bukkit.entity.Player recipient, String reference, Object... replacements) static voidsendSubTitle(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 userstatic voidsendSubTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static voidsendTitle(Collection<org.bukkit.entity.Player> recipients, boolean doPrefix, String reference, Object... replacements) static voidsendTitle(Collection<org.bukkit.entity.Player> recipients, String reference, Object... replacements) static voidsendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, boolean doPrefix, String reference, Object... replacements) static voidsendTitle(Collection<org.bukkit.entity.Player> recipients, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static voidsendTitle(org.bukkit.entity.Player recipient, boolean doPrefix, String reference, Object... replacements) Used to send a (formatted) title to the specified userstatic voidstatic voidsendTitle(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 userstatic voidsendTitle(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacement) static voidsetLanguage(String lang) static voidsetupMessageSender(net.kyori.adventure.platform.bukkit.BukkitAudiences audiences) Used to instantiate a new MessageSender.
-
Field Details
-
MISSINGMESSAGES_FILENAME
- See Also:
-
-
Method Details
-
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
-
dumpMessageSender
@Internal public static void dumpMessageSender()Used to clear the current MessageSender.Warning: This is not API, so it should never be used outside BetterTeams' package
-
getLanguage
-
setLanguage
-
addMessages
This method is used to provide the configuration file in which all the message references are stored, this method also loads the default prefix- Parameters:
configManager- the configuration manager
-
addBackupMessages
public static void addBackupMessages(org.bukkit.configuration.file.YamlConfiguration file) Used to select a file to contain backup messages in the event that the community translations are incomplete- Parameters:
file- The file to load the backup messages from
-
getFile
-
getDefaultMessages
public static org.bukkit.configuration.file.FileConfiguration getDefaultMessages() -
dumpMessages
public static void dumpMessages()Used to clear all messages from the cache -
getMessage
-
getMessage
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 messagereplacements- the replacements for the {n} placeholders ( {0}, {1}, {2}, ... )- Returns:
- the message (without prefix)
-
getMessage
-
sendMessage
-
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 todoPrefix- if the message should have prefixreference- the reference for the messagereplacements- the value that the placeholder should be replaced with
-
sendMessage
-
sendMessage
-
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
Used when you are sending a user a message instead of a message loaded from a file- Parameters:
sender- the player who sent the commandmessage- 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 commandmessage- The message to send to that userdoPrefix- 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 fullComponentmessage to the givenCommandSender- Parameters:
recipient- the target to send the message tomessage- the AdventureComponentto 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
-
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 todoPrefix- if the message should include the prefix or notreference- the reference for the messagereplacements- the value that the placeholder should be replaced with
-
sendTitle
-
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 toplayer- the player to format this message arounddoPrefix- if the message should include the prefix or notreference- the reference for the messagereplacements- 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
-
sendFullTitle
public static void sendFullTitle(org.bukkit.entity.Player recipient, String message, boolean doPrefix) -
sendFullTitle
-
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
-
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 todoPrefix- if the message should include the prefix or notreference- the reference for the messagereplacements- the value that the placeholder should be replaced with
-
sendSubTitle
-
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 toplayer- the player to format this message arounddoPrefix- if the message should include the prefix or notreference- the reference for the messagereplacements- 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
-
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
-
sendFullTitleAndSub
-
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) -
getMessages
Used to store all loaded messages -
getDefaultMessagesConfigManager
-
getPrefix
This is the prefix which goes before all messages related to this plugin -
getPrefixComponent
public static net.kyori.adventure.text.Component getPrefixComponent()
-