Class LegacyUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
Legacy serializer with hex support -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Component
parsePossibleLegacy
(@Nullable String string) Parse a string with possible legacy Ampersand/Section symbolsstatic @NotNull Component
parsePossibleLegacy
(@Nullable String string, @NotNull Context context) Parse a string with possible legacy Ampersand/Section symbols using a parsing Contextstatic @NotNull Component
parsePossibleLegacy
(@Nullable String string, @NotNull TagResolver resolver) Parse a string with possible legacy Ampersand/Section symbols using the provided resolver
-
Field Details
-
LEGACY_HEX_SERIALIZER
public static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer LEGACY_HEX_SERIALIZERLegacy serializer with hex supportUse this as the last available alternative, it is recommended to use MiniMessage instead of this serializer
-
-
Method Details
-
parsePossibleLegacy
Parse a string with possible legacy Ampersand/Section symbols
This method should only be used in case a String is provided from a legacy plugin/mod or legacy source, where it is very likely to get a legacy string. It is not recommended to use this method regularly in any sense
- Parameters:
string
- the string- Returns:
- a parsed string
- Since:
- 1.0.0
-
parsePossibleLegacy
@NotNull public static @NotNull Component parsePossibleLegacy(@Nullable @Nullable String string, @NotNull @NotNull Context context) Parse a string with possible legacy Ampersand/Section symbols using a parsing ContextThis method should only be used in case a String is provided from a legacy plugin/mod or legacy source, where it is very likely to get a legacy string. It is not recommended to use this method regularly in any sense
- Parameters:
string
- the stringcontext
- the provided parsing context- Returns:
- a parsed string
- Since:
- 2.2.1
-
parsePossibleLegacy
@NotNull public static @NotNull Component parsePossibleLegacy(@Nullable @Nullable String string, @NotNull @NotNull TagResolver resolver) Parse a string with possible legacy Ampersand/Section symbols using the provided resolverThis method should only be used in case a String is provided from a legacy plugin/mod or legacy source, where it is very likely to get a legacy string. It is not recommended to use this method regularly in any sense
- Parameters:
string
- the stringresolver
- a resolver- Returns:
- a parsed string
- Since:
- 2.2.1
-