Class MessageService

java.lang.Object
com.zetaplugins.zetacore.services.MessageService

public class MessageService extends Object
Deprecated.
Service for handling messages and localization
  • Constructor Details

    • MessageService

      public MessageService(LocalizationService localizationService)
      Deprecated.
      Constructor for MessageService
      Parameters:
      localizationService - The LocalizationService instance to use for fetching localized messages
  • Method Details

    • getLocalizationService

      protected LocalizationService getLocalizationService()
      Deprecated.
      Gets the LocalizationService instance
      Returns:
      The LocalizationService instance
    • formatMsg

      public net.kyori.adventure.text.Component formatMsg(String msg, MessageService.Replaceable<?>... replaceables)
      Deprecated.
      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(boolean addPrefix, String path, String fallback, MessageService.Replaceable<?>... replaceables)
      Deprecated.
      Gets and formats a message from the config
      Parameters:
      addPrefix - Whether to add the prefix to the message
      path - The path to the message in the config
      fallback - The fallback message
      replaceables - The placeholders to replace
      Returns:
      The formatted message
    • getAndFormatMsgList

      public List<net.kyori.adventure.text.Component> getAndFormatMsgList(String path, MessageService.Replaceable<?>... replaceables)
      Deprecated.
      Gets and formats a list of messages from the config
      Parameters:
      path - The path to the message list in the config
      replaceables - The placeholders to replace
      Returns:
      The list of formatted messages
    • getAccentColor

      public String getAccentColor()
      Deprecated.
      Gets the accent color
      Returns:
      The accent color
    • replacePlaceholders

      @NotNull public @NotNull String replacePlaceholders(String msg, MessageService.Replaceable<?>... replaceables)
      Deprecated.
      Replaces placeholders in a message
      Parameters:
      msg - The message to replace placeholders in
      replaceables - The placeholders to replace
      Returns:
      The message with placeholders replaced
    • replacePlaceholdersWithAccentColors

      @NotNull public @NotNull String replacePlaceholdersWithAccentColors(String msg, MessageService.Replaceable<?>... replaceables)
      Deprecated.
      Replaces placeholders in a message and adds accent colors
      Parameters:
      msg - The message to replace placeholders in
      replaceables - The placeholders to replace
      Returns:
      The message with placeholders and accent colors replaced
    • replaceInBuilder

      protected void replaceInBuilder(StringBuilder builder, String placeholder, String replacement)
      Deprecated.
      Replaces all occurrences of a placeholder in a StringBuilder with a replacement string
      Parameters:
      builder - The StringBuilder to replace placeholders in
      placeholder - The placeholder to replace
      replacement - The replacement string