Package com.nexomc.nexo.utils
Object AdventureUtils
-
- All Implemented Interfaces:
public class AdventureUtils
-
-
Field Summary
Fields Modifier and Type Field Description public final static MiniMessage
STANDARD_MINI_MESSAGE
public final static LegacyComponentSerializer
LEGACY_SERIALIZER
private final MiniMessage
MINI_MESSAGE
public final static AdventureUtils
INSTANCE
-
Method Summary
Modifier and Type Method Description final Boolean
containsLegacyCodes(String value)
final Unit
reload()
final Component
setDefaultStyle(Component $self, TextColor color)
final static MiniMessage
MINI_MESSAGE_PLAYER(Player player)
final static String
parseMiniMessage(String message, TagResolver tagResolver)
final static String
parseLegacy(String message)
Parses the string by deserializing it to a legacy component, then serializing it to a string via MiniMessage final static String
parseLegacyThroughMiniMessage(String message)
Parses a string through both legacy and minimessage serializers. final static TagResolver
tagResolver(String string, String tag)
final TagResolver
tagResolver(String string, Component tag)
final MiniMessage
getMINI_MESSAGE()
-
-
Method Detail
-
containsLegacyCodes
final Boolean containsLegacyCodes(String value)
-
setDefaultStyle
final Component setDefaultStyle(Component $self, TextColor color)
-
MINI_MESSAGE_PLAYER
final static MiniMessage MINI_MESSAGE_PLAYER(Player player)
-
parseMiniMessage
final static String parseMiniMessage(String message, TagResolver tagResolver)
-
parseLegacy
final static String parseLegacy(String message)
Parses the string by deserializing it to a legacy component, then serializing it to a string via MiniMessage
- Parameters:
message
- The string to parse- Returns:
The parsed string
-
parseLegacyThroughMiniMessage
final static String parseLegacyThroughMiniMessage(String message)
Parses a string through both legacy and minimessage serializers. This is useful for parsing strings that may contain legacy formatting codes and modern adventure-tags.
- Parameters:
message
- The component to parse- Returns:
The parsed string
-
tagResolver
final static TagResolver tagResolver(String string, String tag)
-
tagResolver
final TagResolver tagResolver(String string, Component tag)
-
getMINI_MESSAGE
final MiniMessage getMINI_MESSAGE()
-
-
-
-