Package org.strassburger.lifestealz.util
Class MessageUtils
java.lang.Object
org.strassburger.lifestealz.util.MessageUtils
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.Component
formatMsg
(String msg, MessageUtils.Replaceable... replaceables) Formats a message with placeholdersstatic net.kyori.adventure.text.Component
getAndFormatMsg
(boolean addPrefix, String path, String fallback, MessageUtils.Replaceable... replaceables) Gets and formats a message from the config
-
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
-