Package com.zetaplugins.essentialz.util
Class MessageManager
java.lang.Object
com.zetaplugins.essentialz.util.MessageManager
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentformatMsg(String msg, MessageManager.Replaceable<?>... replaceables) Formats a message with placeholdersnet.kyori.adventure.text.ComponentgetAndFormatMsg(MessageStyle style, String path, String fallback, boolean addPrefix, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the confignet.kyori.adventure.text.ComponentgetAndFormatMsg(MessageStyle style, String path, String fallback, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the confignet.kyori.adventure.text.ComponentgetAndFormatMsg(PluginMessage pluginMessage, boolean addPrefix, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config using a PluginMessagenet.kyori.adventure.text.ComponentgetAndFormatMsg(PluginMessage message, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config using a PluginMessage
-
Constructor Details
-
MessageManager
-
-
Method Details
-
formatMsg
public net.kyori.adventure.text.Component formatMsg(String msg, MessageManager.Replaceable<?>... replaceables) Formats a message with placeholders- Parameters:
msg- The message to formatreplaceables- The placeholders to replace- Returns:
- The formatted message
-
getAndFormatMsg
public net.kyori.adventure.text.Component getAndFormatMsg(MessageStyle style, String path, String fallback, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config- Parameters:
style- The style of the messagepath- The path to the message in the configfallback- The fallback messagereplaceables- The placeholders to replace- Returns:
- The formatted message
-
getAndFormatMsg
public net.kyori.adventure.text.Component getAndFormatMsg(MessageStyle style, String path, String fallback, boolean addPrefix, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config- Parameters:
style- The style of the messagepath- The path to the message in the configfallback- The fallback messageaddPrefix- Whether to add the style prefixreplaceables- The placeholders to replace- Returns:
- The formatted message
-
getAndFormatMsg
public net.kyori.adventure.text.Component getAndFormatMsg(PluginMessage message, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config using a PluginMessage- Parameters:
message- The PluginMessage to get the message fromreplaceables- The placeholders to replace- Returns:
- The formatted message
-
getAndFormatMsg
public net.kyori.adventure.text.Component getAndFormatMsg(PluginMessage pluginMessage, boolean addPrefix, MessageManager.Replaceable<?>... replaceables) Gets and formats a message from the config using a PluginMessage- Parameters:
pluginMessage- The PluginMessage to get the message fromreplaceables- The placeholders to replace- Returns:
- The formatted message
-