public static class ITextComponent.Serializer extends java.lang.Object implements com.google.gson.JsonDeserializer<ITextComponent>, com.google.gson.JsonSerializer<ITextComponent>
Modifier and Type | Field and Description |
---|---|
private static com.google.gson.Gson |
GSON |
private static java.lang.reflect.Field |
JSON_READER_LINESTART_FIELD |
private static java.lang.reflect.Field |
JSON_READER_POS_FIELD |
Constructor and Description |
---|
Serializer() |
Modifier and Type | Method and Description |
---|---|
ITextComponent |
deserialize(com.google.gson.JsonElement p_deserialize_1_,
java.lang.reflect.Type p_deserialize_2_,
com.google.gson.JsonDeserializationContext p_deserialize_3_) |
static ITextComponent |
fromJson(com.google.gson.JsonElement p_197672_0_) |
static ITextComponent |
fromJson(java.lang.String json) |
static ITextComponent |
fromJson(com.mojang.brigadier.StringReader p_197671_0_) |
static ITextComponent |
fromJsonLenient(java.lang.String json) |
private static int |
getPos(com.google.gson.stream.JsonReader p_197673_0_) |
com.google.gson.JsonElement |
serialize(ITextComponent p_serialize_1_,
java.lang.reflect.Type p_serialize_2_,
com.google.gson.JsonSerializationContext p_serialize_3_) |
private void |
serializeChatStyle(Style style,
com.google.gson.JsonObject object,
com.google.gson.JsonSerializationContext ctx) |
static java.lang.String |
toJson(ITextComponent component) |
static com.google.gson.JsonElement |
toJsonTree(ITextComponent p_200528_0_) |
private static final com.google.gson.Gson GSON
private static final java.lang.reflect.Field JSON_READER_POS_FIELD
private static final java.lang.reflect.Field JSON_READER_LINESTART_FIELD
public ITextComponent deserialize(com.google.gson.JsonElement p_deserialize_1_, java.lang.reflect.Type p_deserialize_2_, com.google.gson.JsonDeserializationContext p_deserialize_3_) throws com.google.gson.JsonParseException
deserialize
in interface com.google.gson.JsonDeserializer<ITextComponent>
com.google.gson.JsonParseException
private void serializeChatStyle(Style style, com.google.gson.JsonObject object, com.google.gson.JsonSerializationContext ctx)
public com.google.gson.JsonElement serialize(ITextComponent p_serialize_1_, java.lang.reflect.Type p_serialize_2_, com.google.gson.JsonSerializationContext p_serialize_3_)
serialize
in interface com.google.gson.JsonSerializer<ITextComponent>
public static java.lang.String toJson(ITextComponent component)
public static com.google.gson.JsonElement toJsonTree(ITextComponent p_200528_0_)
@Nullable public static ITextComponent fromJson(java.lang.String json)
@Nullable public static ITextComponent fromJson(com.google.gson.JsonElement p_197672_0_)
@Nullable public static ITextComponent fromJsonLenient(java.lang.String json)
public static ITextComponent fromJson(com.mojang.brigadier.StringReader p_197671_0_)
private static int getPos(com.google.gson.stream.JsonReader p_197673_0_)