Interface JSONComponentSerializer.Builder

    • Method Detail

      • options

        @NotNull
        @NotNull JSONComponentSerializer.Builder options​(@NotNull
                                                         @NotNull net.kyori.option.OptionState flags)
        Set the option state to apply on this serializer.

        This controls how the serializer emits and interprets components.

        Parameters:
        flags - the flag set to use
        Returns:
        this builder
        Since:
        4.15.0
        See Also:
        JSONOptions
      • editOptions

        @NotNull
        @NotNull JSONComponentSerializer.Builder editOptions​(@NotNull
                                                             @NotNull java.util.function.Consumer<net.kyori.option.OptionState.Builder> optionEditor)
        Edit the active set of serializer options.
        Parameters:
        optionEditor - the consumer operating on the existing flag set
        Returns:
        this builder
        Since:
        4.15.0
        See Also:
        JSONOptions
      • downsampleColors

        @Deprecated
        @NotNull
        @NotNull JSONComponentSerializer.Builder downsampleColors()
        Deprecated.
        for removal since 4.15.0, change the JSONOptions.EMIT_RGB flag instead
        Sets that the serializer should downsample hex colors to named colors.
        Returns:
        this builder
        Since:
        4.14.0
      • legacyHoverEventSerializer

        @NotNull
        @NotNull JSONComponentSerializer.Builder legacyHoverEventSerializer​(@Nullable
                                                                            @Nullable LegacyHoverEventSerializer serializer)
        Sets a serializer that will be used to interpret legacy hover event value payloads. If the serializer is null, then only HoverEvent.Action.SHOW_TEXT legacy hover events can be deserialized.
        Parameters:
        serializer - serializer
        Returns:
        this builder
        Since:
        4.14.0
      • build

        @NotNull
        @NotNull JSONComponentSerializer build()
        Create a finished serializer instance.
        Returns:
        the new serializer
        Since:
        4.14.0