Class MessageUtils
java.lang.Object
com.zetaplugins.cookieclickerz.util.MessageUtils
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertToLegacy(String input) static net.kyori.adventure.text.ComponentformatMsg(String msg, MessageUtils.Replaceable<?>... replaceables) Formats a message with placeholdersstatic StringGets the accent colorstatic net.kyori.adventure.text.ComponentgetAndFormatMsg(boolean addPrefix, String path, String fallback, MessageUtils.Replaceable<?>... replaceables) Gets and formats a message from the configstatic List<net.kyori.adventure.text.Component> getAndFormatMsgList(String path, MessageUtils.Replaceable<?>... replaceables) static @NotNull StringreplacePlaceholders(String msg, MessageUtils.Replaceable<?>... replaceables)
-
Method Details
-
formatMsg
public static net.kyori.adventure.text.Component formatMsg(String msg, MessageUtils.Replaceable<?>... replaceables) Formats a message with placeholders- Parameters:
msg- The message to formatreplaceables- The placeholders to replace- Returns:
- The formatted message
-
getAndFormatMsg
public static net.kyori.adventure.text.Component getAndFormatMsg(boolean addPrefix, String path, String fallback, MessageUtils.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 static List<net.kyori.adventure.text.Component> getAndFormatMsgList(String path, MessageUtils.Replaceable<?>... replaceables) -
getAccentColor
Gets the accent color- Returns:
- The accent color
-
replacePlaceholders
@NotNull public static @NotNull String replacePlaceholders(String msg, MessageUtils.Replaceable<?>... replaceables) -
convertToLegacy
-