Interface LegacyComponentSerializer.Builder

All Superinterfaces:
net.kyori.adventure.util.Buildable.Builder<LegacyComponentSerializer>
Enclosing interface:
LegacyComponentSerializer

public static interface LegacyComponentSerializer.Builder
extends net.kyori.adventure.util.Buildable.Builder<LegacyComponentSerializer>
Since:
4.0.0
  • Method Details

    • character

      @NonNull LegacyComponentSerializer.Builder character​(char legacyCharacter)
      Sets the legacy character used by the serializer.
      Parameters:
      legacyCharacter - the legacy character
      Returns:
      this builder
      Since:
      4.0.0
    • hexCharacter

      @NonNull LegacyComponentSerializer.Builder hexCharacter​(char legacyHexCharacter)
      Sets the legacy hex character used by the serializer.
      Parameters:
      legacyHexCharacter - the legacy hex character.
      Returns:
      this builder
      Since:
      4.0.0
    • extractUrls

      @NonNull LegacyComponentSerializer.Builder extractUrls()
      Sets that the serializer should extract URLs into ClickEvents when deserializing.
      Returns:
      this builder
      Since:
      4.0.0
    • extractUrls

      @NonNull LegacyComponentSerializer.Builder extractUrls​(@NonNull Pattern pattern)
      Sets that the serializer should extract URLs into ClickEvents when deserializing.
      Parameters:
      pattern - the url pattern
      Returns:
      this builder
      Since:
      4.2.0
    • extractUrls

      @NonNull LegacyComponentSerializer.Builder extractUrls​(@Nullable net.kyori.adventure.text.format.Style style)
      Sets that the serializer should extract URLs into ClickEvents when deserializing.
      Parameters:
      style - the style to use for extracted links
      Returns:
      this builder
      Since:
      4.0.0
    • extractUrls

      @NonNull LegacyComponentSerializer.Builder extractUrls​(@NonNull Pattern pattern, @Nullable net.kyori.adventure.text.format.Style style)
      Sets that the serializer should extract URLs into ClickEvents when deserializing.
      Parameters:
      pattern - the url pattern
      Returns:
      this builder
      Since:
      4.2.0
    • hexColors

      @NonNull LegacyComponentSerializer.Builder hexColors()
      Sets that the serializer should support hex colors.

      Otherwise, hex colors are downsampled to the nearest named color.

      Returns:
      this builder
      Since:
      4.0.0
    • useUnusualXRepeatedCharacterHexFormat

      @NonNull LegacyComponentSerializer.Builder useUnusualXRepeatedCharacterHexFormat()
      Sets that the serializer should use the '&x' repeated code format when serializing hex colors. Note that messages in this format can still be deserialized, even with this option disabled.

      This is the format adopted by the BungeeCord (and by usage, Spigot) text API.

      The format is difficult to manipulate and read, and its use is not recommended. Support is provided for it only to allow plugin developers to use this library alongside parts of the Spigot API which expect legacy strings in this format.

      It is recommended to use only when absolutely necessary, and when no better alternatives are available.

      Returns:
      this builder
      Since:
      4.0.0
    • build

      @NonNull LegacyComponentSerializer build()
      Builds the serializer.
      Specified by:
      build in interface net.kyori.adventure.util.Buildable.Builder<LegacyComponentSerializer>
      Returns:
      the built serializer