public interface LegacyComponentSerializer
extends net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.TextComponent,java.lang.String>
Legacy does not support more complex features such as, but not limited
to, ClickEvent and HoverEvent.
| Modifier and Type | Field and Description |
|---|---|
static char |
CHARACTER
The legacy character.
|
static LegacyComponentSerializer |
INSTANCE
Deprecated.
use
legacy() |
| Modifier and Type | Method and Description |
|---|---|
default @NonNull net.kyori.text.TextComponent |
deserialize(@NonNull java.lang.String input)
Deserialize a component from a
String with the legacy character. |
@NonNull net.kyori.text.TextComponent |
deserialize(@NonNull java.lang.String input,
char character)
Deserialize a component from a
String with the specified character legacy character. |
static @NonNull LegacyComponentSerializer |
legacy()
Gets a component serializer for legacy-based serialization and deserialization.
|
static @NonNull LegacyComponentSerializer |
legacyLinking()
Gets a legacy component serializer for legacy serialization and deserialization that detects
and makes URLs clickable in chat.
|
static @NonNull LegacyComponentSerializer |
legacyLinking(@NonNull net.kyori.text.format.Style style)
Creates a legacy component serializer for legacy-based serialization and deserialization that
detects links and applies
style. |
default @NonNull java.lang.String |
serialize(@NonNull net.kyori.text.Component component)
Serializes a component into a
String with the specified legacy character. |
@NonNull java.lang.String |
serialize(@NonNull net.kyori.text.Component component,
char character)
Serializes a component into a
String with the specified character legacy character. |
@Deprecated static final LegacyComponentSerializer INSTANCE
legacy()static final char CHARACTER
static @NonNull LegacyComponentSerializer legacy()
legacyLinking().static @NonNull LegacyComponentSerializer legacyLinking()
static @NonNull LegacyComponentSerializer legacyLinking(@NonNull net.kyori.text.format.Style style)
style.style - the style to usestyledefault @NonNull net.kyori.text.TextComponent deserialize(@NonNull java.lang.String input)
String with the legacy character.deserialize in interface net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.TextComponent,java.lang.String>input - the input@NonNull net.kyori.text.TextComponent deserialize(@NonNull java.lang.String input,
char character)
String with the specified character legacy character.input - the inputcharacter - the legacy characterdefault @NonNull java.lang.String serialize(@NonNull net.kyori.text.Component component)
String with the specified legacy character.serialize in interface net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.TextComponent,java.lang.String>component - the component@NonNull java.lang.String serialize(@NonNull net.kyori.text.Component component,
char character)
String with the specified character legacy character.component - the componentcharacter - the legacy character