Class Legacy.TextSerializer
java.lang.Object
io.rhythmknights.coreapi.component.utility.Legacy.TextSerializer
- Enclosing class:
Legacy
Custom serializer that combines both legacy and MiniMessage formats
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.Componentdeserialize(@NotNull String text) Converts a string with any combination of formatting styles to a Component Supports: - Legacy format (&fand&#FFFFFF) - MiniMessage format (<white>and<#FFFFFF>)@NotNull Stringserialize(@NotNull net.kyori.adventure.text.Component component) Serializes a Component to a string with legacy formatting using § symbols This is what Bukkit inventories expect for proper color display
-
Constructor Details
-
TextSerializer
public TextSerializer()
-
-
Method Details
-
deserialize
@NotNull public @NotNull net.kyori.adventure.text.Component deserialize(@NotNull @NotNull String text) Converts a string with any combination of formatting styles to a Component Supports: - Legacy format (&fand&#FFFFFF) - MiniMessage format (<white>and<#FFFFFF>)- Parameters:
text- Text with any supported formatting- Returns:
- Adventure Component with applied formatting
-
serialize
@NotNull public @NotNull String serialize(@NotNull @NotNull net.kyori.adventure.text.Component component) Serializes a Component to a string with legacy formatting using § symbols This is what Bukkit inventories expect for proper color display- Parameters:
component- Component to serialize- Returns:
- String with legacy formatting using § symbols
-