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 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 incompletestatic void
addMessages
(@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 void
Used to clear all messages from the cachestatic void
Used to clear the current MessageSender.static org.bukkit.configuration.file.FileConfiguration
static ConfigManager
static @NotNull File
getFile()
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 messagestatic @NotNull String
getMessage
(org.bukkit.OfflinePlayer player, String reference, Object... replacements) Used to store all loaded messagesstatic String
This is the prefix which goes before all messages related to this pluginstatic net.kyori.adventure.text.Component
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 filestatic 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 filestatic 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 fullComponent
message to the givenCommandSender
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, @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
(Collection<? extends org.bukkit.command.CommandSender> recipients, 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 userstatic 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
sendMessage
(org.bukkit.command.CommandSender recipient, 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, @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
(Collection<org.bukkit.entity.Player> recipients, 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 userstatic 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 userstatic void
sendSubTitle
(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacements) static void
sendSubTitle
(org.bukkit.entity.Player recipient, 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, @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
(Collection<org.bukkit.entity.Player> recipients, 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 userstatic 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 userstatic void
sendTitle
(org.bukkit.entity.Player recipient, @Nullable org.bukkit.OfflinePlayer player, String reference, Object... replacement) static void
static void
setLanguage
(String lang) static void
setupMessageSender
(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 fullComponent
message to the givenCommandSender
- Parameters:
recipient
- the target to send the message tomessage
- the AdventureComponent
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
-
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()
-