public final class PaperComponents extends Object
Component
s and related.Modifier and Type | Method and Description |
---|---|
static @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer |
colorDownsamplingGsonSerializer()
Get a serializer for
Component s that will convert to and from the
standard JSON serialization format using Gson, downsampling any RGB colors
to their nearest NamedTextColor counterpart. |
static @NonNull net.kyori.adventure.text.flattener.ComponentFlattener |
flattener()
Return a component flattener that can use game data to resolve extra information about components.
|
static @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer |
gsonSerializer()
Get a serializer for
Component s that will convert to and from the
standard JSON serialization format using Gson. |
static @NonNull net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer |
legacySectionSerializer()
Get a serializer for
Component s that will convert to and from the
legacy component format used by Bukkit. |
static @NonNull net.kyori.adventure.text.serializer.plain.PlainComponentSerializer |
plainSerializer()
Get a serializer for
Component s that will convert components to
a plain-text string. |
public static @NonNull net.kyori.adventure.text.flattener.ComponentFlattener flattener()
public static @NonNull net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainSerializer()
Component
s that will convert components to
a plain-text string.
Implementations may provide a serializer capable of processing any information that requires access to implementation details.
public static @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonSerializer()
Component
s that will convert to and from the
standard JSON serialization format using Gson.
Implementations may provide a serializer capable of processing any information that requires implementation details, such as legacy (pre-1.16) hover events.
public static @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonSerializer()
Component
s that will convert to and from the
standard JSON serialization format using Gson, downsampling any RGB colors
to their nearest NamedTextColor
counterpart.
Implementations may provide a serializer capable of processing any information that requires implementation details, such as legacy (pre-1.16) hover events.
public static @NonNull net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacySectionSerializer()
Component
s that will convert to and from the
legacy component format used by Bukkit. This serializer uses the
LegacyComponentSerializer.Builder#useUnusualXRepeatedCharacterHexFormat()
option to match upstream behavior.
This legacy serializer uses the standard section symbol to mark formatting characters.
Implementations may provide a serializer capable of processing any information that requires access to implementation details.
Copyright © 2021. All rights reserved.