Class GsonComponentSerializerExtended
java.lang.Object
com.github.retrooper.packetevents.util.adventure.GsonComponentSerializerExtended
- All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentDecoder<String,
,net.kyori.adventure.text.Component> net.kyori.adventure.text.serializer.ComponentEncoder<net.kyori.adventure.text.Component,
,String> net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,
,net.kyori.adventure.text.Component, String> net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
,net.kyori.adventure.text.serializer.json.JSONComponentSerializer
,net.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>
public class GsonComponentSerializerExtended
extends Object
implements net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
Implementing adventures
GsonComponentSerializer
to fix jsons for legacy versions.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder, net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Provider
-
Constructor Summary
ConstructorDescriptionGsonComponentSerializerExtended
(boolean downsampleColor, boolean emitLegacyHover) -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.Component
deserialize
(@NotNull String string) @NotNull net.kyori.adventure.text.Component
deserializeFromTree
(@NotNull com.google.gson.JsonElement input) @Nullable net.kyori.adventure.text.Component
deserializeOr
(@Nullable String input, @Nullable net.kyori.adventure.text.Component fallback) @NotNull UnaryOperator<com.google.gson.GsonBuilder>
@NotNull String
serialize
(@NotNull net.kyori.adventure.text.Component component) @NotNull com.google.gson.Gson
@NotNull com.google.gson.JsonElement
serializeToTree
(@NotNull net.kyori.adventure.text.Component component) @NotNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.kyori.adventure.text.serializer.ComponentSerializer
deseializeOrNull, deserializeOrNull, serializeOr, serializeOrNull
-
Constructor Details
-
GsonComponentSerializerExtended
public GsonComponentSerializerExtended(boolean downsampleColor, boolean emitLegacyHover)
-
-
Method Details
-
serializer
@NotNull public @NotNull com.google.gson.Gson serializer()- Specified by:
serializer
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
populator
- Specified by:
populator
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
deserialize
@NotNull public @NotNull net.kyori.adventure.text.Component deserialize(@NotNull @NotNull String string) - Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentDecoder<String,
net.kyori.adventure.text.Component> - Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,
net.kyori.adventure.text.Component, String>
-
deserializeOr
@Nullable public @Nullable net.kyori.adventure.text.Component deserializeOr(@Nullable @Nullable String input, @Nullable @Nullable net.kyori.adventure.text.Component fallback) - Specified by:
deserializeOr
in interfacenet.kyori.adventure.text.serializer.ComponentDecoder<String,
net.kyori.adventure.text.Component> - Specified by:
deserializeOr
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,
net.kyori.adventure.text.Component, String>
-
serialize
@NotNull public @NotNull String serialize(@NotNull @NotNull net.kyori.adventure.text.Component component) - Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentEncoder<net.kyori.adventure.text.Component,
String> - Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,
net.kyori.adventure.text.Component, String>
-
deserializeFromTree
@NotNull public @NotNull net.kyori.adventure.text.Component deserializeFromTree(@NotNull @NotNull com.google.gson.JsonElement input) - Specified by:
deserializeFromTree
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
serializeToTree
@NotNull public @NotNull com.google.gson.JsonElement serializeToTree(@NotNull @NotNull net.kyori.adventure.text.Component component) - Specified by:
serializeToTree
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
toBuilder
@NotNull public @NotNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder toBuilder()- Specified by:
toBuilder
in interfacenet.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>
-