Package net.minecraft.network.chat
Class Component.Serializer
java.lang.Object
net.minecraft.network.chat.Component.Serializer
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<MutableComponent>
,com.google.gson.JsonSerializer<Component>
- Enclosing interface:
- Component
public static class Component.Serializer
extends Object
implements com.google.gson.JsonDeserializer<MutableComponent>, com.google.gson.JsonSerializer<Component>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize(com.google.gson.JsonElement p_130694_, Type p_130695_, com.google.gson.JsonDeserializationContext p_130696_)
static MutableComponent
fromJson(com.google.gson.JsonElement p_130692_)
static MutableComponent
fromJson(com.mojang.brigadier.StringReader p_130700_)
static MutableComponent
static MutableComponent
fromJsonLenient(String p_130715_)
private static int
getPos(com.google.gson.stream.JsonReader p_130698_)
parseSeparator(Type p_178416_, com.google.gson.JsonDeserializationContext p_178417_, com.google.gson.JsonObject p_178418_)
com.google.gson.JsonElement
private void
serializeSeparator(com.google.gson.JsonSerializationContext p_178412_, com.google.gson.JsonObject p_178413_, Optional<Component> p_178414_)
private void
serializeStyle(Style p_130710_, com.google.gson.JsonObject p_130711_, com.google.gson.JsonSerializationContext p_130712_)
static String
static com.google.gson.JsonElement
toJsonTree(Component p_130717_)
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON -
JSON_READER_POS
-
JSON_READER_LINESTART
-
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
deserialize
public MutableComponent deserialize(com.google.gson.JsonElement p_130694_, Type p_130695_, com.google.gson.JsonDeserializationContext p_130696_) throws com.google.gson.JsonParseException- Specified by:
deserialize
in interfacecom.google.gson.JsonDeserializer<MutableComponent>
- Throws:
com.google.gson.JsonParseException
-
parseSeparator
-
serializeStyle
private void serializeStyle(Style p_130710_, com.google.gson.JsonObject p_130711_, com.google.gson.JsonSerializationContext p_130712_) -
serialize
public com.google.gson.JsonElement serialize(Component p_130706_, Type p_130707_, com.google.gson.JsonSerializationContext p_130708_)- Specified by:
serialize
in interfacecom.google.gson.JsonSerializer<Component>
-
serializeSeparator
-
toJson
-
toJsonTree
-
fromJson
-
fromJson
-
fromJsonLenient
-
fromJson
-
getPos
private static int getPos(com.google.gson.stream.JsonReader p_130698_)
-