Interface GsonComponentSerializer.Builder
- All Superinterfaces:
net.kyori.adventure.util.Buildable.Builder<GsonComponentSerializer>
- Enclosing interface:
- GsonComponentSerializer
public static interface GsonComponentSerializer.Builder extends net.kyori.adventure.util.Buildable.Builder<GsonComponentSerializer>
A builder for
GsonComponentSerializer
.- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description @NonNull GsonComponentSerializer
build()
Builds the serializer.@NonNull GsonComponentSerializer.Builder
downsampleColors()
Sets that the serializer should downsample hex colors to named colors.@NonNull GsonComponentSerializer.Builder
emitLegacyHoverEvent()
Output a legacy hover eventvalue
in addition to the moderncontents
.@NonNull GsonComponentSerializer.Builder
legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer)
Sets a serializer that will be used to interpret legacy hover eventvalue
payloads.
-
Method Details
-
downsampleColors
@NonNull GsonComponentSerializer.Builder downsampleColors()Sets that the serializer should downsample hex colors to named colors.- Returns:
- this builder
- Since:
- 4.0.0
-
legacyHoverEventSerializer
@NonNull GsonComponentSerializer.Builder legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer)Sets 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
-
emitLegacyHoverEvent
@NonNull GsonComponentSerializer.Builder emitLegacyHoverEvent()Output a legacy hover eventvalue
in addition to the moderncontents
.A
legacy hover serializer
must also be set to serialize any hover events beyond those with actionHoverEvent.Action.SHOW_TEXT
- Returns:
- this builder
- Since:
- 4.0.0
-
build
@NonNull GsonComponentSerializer build()Builds the serializer.- Specified by:
build
in interfacenet.kyori.adventure.util.Buildable.Builder<GsonComponentSerializer>
- Returns:
- the built serializer
-