Interface GsonComponentSerializer.Builder
- All Superinterfaces:
AbstractBuilder<GsonComponentSerializer>
,Buildable.Builder<GsonComponentSerializer>
,JSONComponentSerializer.Builder
- Enclosing interface:
- GsonComponentSerializer
public static interface GsonComponentSerializer.Builder
extends AbstractBuilder<GsonComponentSerializer>, Buildable.Builder<GsonComponentSerializer>, JSONComponentSerializer.Builder
A builder for
GsonComponentSerializer
.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull GsonComponentSerializer
build()
Builds the serializer.default @NotNull GsonComponentSerializer.Builder
Sets that the serializer should downsample hex colors to named colors.@NotNull GsonComponentSerializer.Builder
editOptions
(@NotNull Consumer<net.kyori.option.OptionState.Builder> optionEditor) default @NotNull GsonComponentSerializer.Builder
Deprecated.default @NotNull GsonComponentSerializer.Builder
legacyHoverEventSerializer
(@Nullable LegacyHoverEventSerializer serializer) Deprecated.@NotNull GsonComponentSerializer.Builder
legacyHoverEventSerializer
(@Nullable LegacyHoverEventSerializer serializer) @NotNull GsonComponentSerializer.Builder
options
(@NotNull net.kyori.option.OptionState flags)
-
Method Details
-
options
@NotNull @NotNull GsonComponentSerializer.Builder options(@NotNull @NotNull net.kyori.option.OptionState flags) - Specified by:
options
in interfaceJSONComponentSerializer.Builder
-
editOptions
@NotNull @NotNull GsonComponentSerializer.Builder editOptions(@NotNull @NotNull Consumer<net.kyori.option.OptionState.Builder> optionEditor) - Specified by:
editOptions
in interfaceJSONComponentSerializer.Builder
-
downsampleColors
Sets that the serializer should downsample hex colors to named colors.- Specified by:
downsampleColors
in interfaceJSONComponentSerializer.Builder
- Returns:
- this builder
- Since:
- 4.0.0
-
legacyHoverEventSerializer
@Deprecated @NotNull default @NotNull GsonComponentSerializer.Builder legacyHoverEventSerializer(@Nullable @Nullable LegacyHoverEventSerializer serializer) Deprecated.for removal since 4.14.0, uselegacyHoverEventSerializer(net.kyori.adventure.text.serializer.json.LegacyHoverEventSerializer)
insteadSets a serializer that will be used to interpret legacy hover eventvalue
payloads. If the serializer isnull
, then onlyHoverEvent.Action.SHOW_TEXT
legacy hover events can be deserialized.- Parameters:
serializer
- serializer- Returns:
- this builder
- Since:
- 4.0.0
-
legacyHoverEventSerializer
@NotNull @NotNull GsonComponentSerializer.Builder legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer) - Specified by:
legacyHoverEventSerializer
in interfaceJSONComponentSerializer.Builder
-
emitLegacyHoverEvent
Deprecated.- Specified by:
emitLegacyHoverEvent
in interfaceJSONComponentSerializer.Builder
- Since:
- 4.0.0
-
build
Builds the serializer.- Specified by:
build
in interfaceAbstractBuilder<GsonComponentSerializer>
- Specified by:
build
in interfaceBuildable.Builder<GsonComponentSerializer>
- Specified by:
build
in interfaceJSONComponentSerializer.Builder
- Returns:
- the built serializer
-
legacyHoverEventSerializer(net.kyori.adventure.text.serializer.json.LegacyHoverEventSerializer)
instead