Class PlainComponentSerializer
- java.lang.Object
-
- net.kyori.adventure.text.serializer.plain.PlainComponentSerializer
-
- All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
public class PlainComponentSerializer extends Object implements net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
A plain component serializer.Plain does not support more complex features such as, but not limited to, colours, decorations,
ClickEvent
, andHoverEvent
.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description PlainComponentSerializer()
Constructs.PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)
Constructs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull net.kyori.adventure.text.TextComponent
deserialize(@NonNull String input)
static @NonNull PlainComponentSerializer
plain()
A component serializer for plain-based serialization and deserialization.void
serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)
Serializes.@NonNull String
serialize(@NonNull net.kyori.adventure.text.Component component)
-
-
-
Constructor Detail
-
PlainComponentSerializer
public PlainComponentSerializer()
Constructs.- Since:
- 4.0.0
-
PlainComponentSerializer
public PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)
Constructs.- Parameters:
keybind
- the keybind renderertranslatable
- the translatable renderer- Since:
- 4.0.0
-
-
Method Detail
-
plain
public static @NonNull PlainComponentSerializer plain()
A component serializer for plain-based serialization and deserialization.- Returns:
- serializer instance
- Since:
- 4.0.0
-
deserialize
public @NonNull net.kyori.adventure.text.TextComponent deserialize(@NonNull String input)
- Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
public @NonNull String serialize(@NonNull net.kyori.adventure.text.Component component)
- Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
public void serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)
Serializes.- Parameters:
sb
- the string buildercomponent
- the component- Since:
- 4.0.0
-
-