Package com.earth2me.essentials.utils
Class AdventureUtil
java.lang.Object
com.earth2me.essentials.utils.AdventureUtil
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
adventureToLegacy
(net.kyori.adventure.text.Component component) Converts an adventure component to a section sign legacy string.static String
escapeTags
(String input) Convenience method for submodules to escape MiniMessage tags.static net.kyori.adventure.text.format.NamedTextColor
fromChar
(char c) Get theNamedTextColor
from its associated section sign char.static net.kyori.adventure.text.Component
legacyToAdventure
(String text) Converts a section sign legacy string to an adventure component.static String
legacyToMini
(String text) Converts a section sign legacy string to a MiniMessage string.static String
legacyToMini
(String text, boolean useCustomTags) Converts a section sign legacy string to a MiniMessage string.static net.kyori.adventure.text.minimessage.MiniMessage
static String
miniToLegacy
(String format) Converts a MiniMessage string to a section sign legacy string.Parameters for a translation message are not parsed for MiniMessage by default to avoid injection.static void
setEss
(IEssentials ess)
-
Method Details
-
setEss
-
miniMessage
public static net.kyori.adventure.text.minimessage.MiniMessage miniMessage() -
legacyToAdventure
Converts a section sign legacy string to an adventure component. -
adventureToLegacy
Converts an adventure component to a section sign legacy string. -
miniToLegacy
Converts a MiniMessage string to a section sign legacy string. -
legacyToMini
Converts a section sign legacy string to a MiniMessage string. -
legacyToMini
Converts a section sign legacy string to a MiniMessage string.- Parameters:
useCustomTags
- true if gold and red colors should use primary and secondary tags instead.
-
fromChar
public static net.kyori.adventure.text.format.NamedTextColor fromChar(char c) Get theNamedTextColor
from its associated section sign char. -
escapeTags
Convenience method for submodules to escape MiniMessage tags. -
parsed
Parameters for a translation message are not parsed for MiniMessage by default to avoid injection. If you want a parameter to be parsed for MiniMessage you must wrap it in a ParsedPlaceholder by using this method.
-