Class MessageService
java.lang.Object
com.zetaplugins.zetacore.services.MessageService
Deprecated.
Service for handling messages and localization
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMessageService(LocalizationService localizationService) Deprecated.Constructor for MessageService -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentformatMsg(String msg, MessageService.Replaceable<?>... replaceables) Deprecated.Formats a message with placeholdersDeprecated.Gets the accent colornet.kyori.adventure.text.ComponentgetAndFormatMsg(boolean addPrefix, String path, String fallback, MessageService.Replaceable<?>... replaceables) Deprecated.Gets and formats a message from the configList<net.kyori.adventure.text.Component> getAndFormatMsgList(String path, MessageService.Replaceable<?>... replaceables) Deprecated.Gets and formats a list of messages from the configprotected LocalizationServiceDeprecated.Gets the LocalizationService instanceprotected voidreplaceInBuilder(StringBuilder builder, String placeholder, String replacement) Deprecated.Replaces all occurrences of a placeholder in a StringBuilder with a replacement string@NotNull StringreplacePlaceholders(String msg, MessageService.Replaceable<?>... replaceables) Deprecated.Replaces placeholders in a message@NotNull StringreplacePlaceholdersWithAccentColors(String msg, MessageService.Replaceable<?>... replaceables) Deprecated.Replaces placeholders in a message and adds accent colors
-
Constructor Details
-
MessageService
Deprecated.Constructor for MessageService- Parameters:
localizationService- The LocalizationService instance to use for fetching localized messages
-
-
Method Details
-
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 formatreplaceables- 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 messagepath- The path to the message in the configfallback- The fallback messagereplaceables- 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 configreplaceables- The placeholders to replace- Returns:
- The list of formatted messages
-
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 inreplaceables- 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 inreplaceables- The placeholders to replace- Returns:
- The message with placeholders and accent colors replaced
-
replaceInBuilder
Deprecated.Replaces all occurrences of a placeholder in a StringBuilder with a replacement string- Parameters:
builder- The StringBuilder to replace placeholders inplaceholder- The placeholder to replacereplacement- The replacement string
-
AdventureMessengerorLegacyMessengerinstead.