Class Legacy.TextSerializer

java.lang.Object
io.rhythmknights.coreapi.component.utility.Legacy.TextSerializer
Enclosing class:
Legacy

public static class Legacy.TextSerializer extends Object
Custom serializer that combines both legacy and MiniMessage formats
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.kyori.adventure.text.Component
    deserialize(@NotNull String text)
    Converts a string with any combination of formatting styles to a Component Supports: - Legacy format (&f and &#FFFFFF) - MiniMessage format (<white> and <#FFFFFF>)
    @NotNull String
    serialize(@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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 (&f and &#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