Class MessageManager

java.lang.Object
com.zetaplugins.essentialz.util.MessageManager

public class MessageManager extends Object
  • Constructor Details

    • MessageManager

      public MessageManager(EssentialZ plugin)
  • 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 format
      replaceables - 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 message
      path - The path to the message in the config
      fallback - The fallback message
      replaceables - 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 message
      path - The path to the message in the config
      fallback - The fallback message
      addPrefix - Whether to add the style prefix
      replaceables - 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 from
      replaceables - 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 from
      replaceables - The placeholders to replace
      Returns:
      The formatted message