Package com.zetaplugins.timberz.service
Class MessageService
java.lang.Object
com.zetaplugins.timberz.service.MessageService
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToLegacy
(String input) net.kyori.adventure.text.Component
formatMsg
(String msg, MessageService.Replaceable<?>... replaceables) Formats a message with placeholdersGets the accent colornet.kyori.adventure.text.Component
getAndFormatMsg
(boolean addPrefix, String path, String fallback, MessageService.Replaceable<?>... replaceables) Gets and formats a message from the configList
<net.kyori.adventure.text.Component> getAndFormatMsgList
(String path, MessageService.Replaceable<?>... replaceables) @NotNull String
replacePlaceholders
(String msg, MessageService.Replaceable<?>... replaceables)
-
Constructor Details
-
MessageService
-
-
Method Details
-
formatMsg
public net.kyori.adventure.text.Component formatMsg(String msg, MessageService.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(boolean addPrefix, String path, String fallback, MessageService.Replaceable<?>... replaceables) 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) -
getAccentColor
Gets the accent color- Returns:
- The accent color
-
replacePlaceholders
@NotNull public @NotNull String replacePlaceholders(String msg, MessageService.Replaceable<?>... replaceables) -
convertToLegacy
-