Package net.minecraft.text
Class Text.Serializer
java.lang.Object
net.minecraft.text.Text.Serializer
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<MutableText>,com.google.gson.JsonSerializer<Text>
- Enclosing interface:
- Text
public static class Text.Serializer extends Object implements com.google.gson.JsonDeserializer<MutableText>, com.google.gson.JsonSerializer<Text>
A JSON serializer for
Text.- Mappings:
Namespace Name official on$aintermediary net/minecraft/class_2561$class_2562named net/minecraft/text/Text$Serializer
-
Field Summary
Fields Modifier and Type Field Description private static com.google.gson.GsonGSONprivate static FieldJSON_READER_LINE_STARTprivate static FieldJSON_READER_POS -
Constructor Summary
Constructors Constructor Description Serializer() -
Method Summary
Modifier and Type Method Description private voidaddStyle(Style style, com.google.gson.JsonObject json, com.google.gson.JsonSerializationContext context)MutableTextdeserialize(com.google.gson.JsonElement jsonElement, Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext)static @Nullable MutableTextfromJson(com.google.gson.JsonElement json)static MutableTextfromJson(com.mojang.brigadier.StringReader reader)static @Nullable MutableTextfromJson(String json)static @Nullable MutableTextfromLenientJson(String json)private static intgetPosition(com.google.gson.stream.JsonReader reader)com.google.gson.JsonElementserialize(Text text, Type type, com.google.gson.JsonSerializationContext jsonSerializationContext)static StringtoJson(Text text)static com.google.gson.JsonElementtoJsonTree(Text text)
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON- Mappings:
Namespace Name Mixin selector official aLon$a;a:Lcom/google/gson/Gson;intermediary field_11754Lnet/minecraft/class_2561$class_2562;field_11754:Lcom/google/gson/Gson;named GSONLnet/minecraft/text/Text$Serializer;GSON:Lcom/google/gson/Gson;
-
JSON_READER_POS
- Mappings:
Namespace Name Mixin selector official bLon$a;b:Ljava/lang/reflect/Field;intermediary field_11753Lnet/minecraft/class_2561$class_2562;field_11753:Ljava/lang/reflect/Field;named JSON_READER_POSLnet/minecraft/text/Text$Serializer;JSON_READER_POS:Ljava/lang/reflect/Field;
-
JSON_READER_LINE_START
- Mappings:
Namespace Name Mixin selector official cLon$a;c:Ljava/lang/reflect/Field;intermediary field_11752Lnet/minecraft/class_2561$class_2562;field_11752:Ljava/lang/reflect/Field;named JSON_READER_LINE_STARTLnet/minecraft/text/Text$Serializer;JSON_READER_LINE_START:Ljava/lang/reflect/Field;
-
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
deserialize
public MutableText deserialize(com.google.gson.JsonElement jsonElement, Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext) throws com.google.gson.JsonParseException- Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<MutableText>- Throws:
com.google.gson.JsonParseException- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lot;intermediary method_10871Lnet/minecraft/class_2561$class_2562;method_10871(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/class_5250;named deserializeLnet/minecraft/text/Text$Serializer;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/text/MutableText;
-
addStyle
private void addStyle(Style style, com.google.gson.JsonObject json, com.google.gson.JsonSerializationContext context)- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lox;Lcom/google/gson/JsonObject;Lcom/google/gson/JsonSerializationContext;)Vintermediary method_10875Lnet/minecraft/class_2561$class_2562;method_10875(Lnet/minecraft/class_2583;Lcom/google/gson/JsonObject;Lcom/google/gson/JsonSerializationContext;)Vnamed addStyleLnet/minecraft/text/Text$Serializer;addStyle(Lnet/minecraft/text/Style;Lcom/google/gson/JsonObject;Lcom/google/gson/JsonSerializationContext;)V
-
serialize
public com.google.gson.JsonElement serialize(Text text, Type type, com.google.gson.JsonSerializationContext jsonSerializationContext)- Specified by:
serializein interfacecom.google.gson.JsonSerializer<Text>- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lon;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;intermediary method_10874Lnet/minecraft/class_2561$class_2562;method_10874(Lnet/minecraft/class_2561;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;named serializeLnet/minecraft/text/Text$Serializer;serialize(Lnet/minecraft/text/Text;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
-
toJson
- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lon;)Ljava/lang/String;intermediary method_10867Lnet/minecraft/class_2561$class_2562;method_10867(Lnet/minecraft/class_2561;)Ljava/lang/String;named toJsonLnet/minecraft/text/Text$Serializer;toJson(Lnet/minecraft/text/Text;)Ljava/lang/String;
-
toJsonTree
- Mappings:
Namespace Name Mixin selector official bLon$a;b(Lon;)Lcom/google/gson/JsonElement;intermediary method_10868Lnet/minecraft/class_2561$class_2562;method_10868(Lnet/minecraft/class_2561;)Lcom/google/gson/JsonElement;named toJsonTreeLnet/minecraft/text/Text$Serializer;toJsonTree(Lnet/minecraft/text/Text;)Lcom/google/gson/JsonElement;
-
fromJson
- Mappings:
Namespace Name Mixin selector official aLon$a;a(Ljava/lang/String;)Lot;intermediary method_10877Lnet/minecraft/class_2561$class_2562;method_10877(Ljava/lang/String;)Lnet/minecraft/class_5250;named fromJsonLnet/minecraft/text/Text$Serializer;fromJson(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
fromJson
- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lcom/google/gson/JsonElement;)Lot;intermediary method_10872Lnet/minecraft/class_2561$class_2562;method_10872(Lcom/google/gson/JsonElement;)Lnet/minecraft/class_5250;named fromJsonLnet/minecraft/text/Text$Serializer;fromJson(Lcom/google/gson/JsonElement;)Lnet/minecraft/text/MutableText;
-
fromLenientJson
- Mappings:
Namespace Name Mixin selector official bLon$a;b(Ljava/lang/String;)Lot;intermediary method_10873Lnet/minecraft/class_2561$class_2562;method_10873(Ljava/lang/String;)Lnet/minecraft/class_5250;named fromLenientJsonLnet/minecraft/text/Text$Serializer;fromLenientJson(Ljava/lang/String;)Lnet/minecraft/text/MutableText;
-
fromJson
- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lcom/mojang/brigadier/StringReader;)Lot;intermediary method_10879Lnet/minecraft/class_2561$class_2562;method_10879(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/class_5250;named fromJsonLnet/minecraft/text/Text$Serializer;fromJson(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/text/MutableText;
-
getPosition
private static int getPosition(com.google.gson.stream.JsonReader reader)- Mappings:
Namespace Name Mixin selector official aLon$a;a(Lcom/google/gson/stream/JsonReader;)Iintermediary method_10880Lnet/minecraft/class_2561$class_2562;method_10880(Lcom/google/gson/stream/JsonReader;)Inamed getPositionLnet/minecraft/text/Text$Serializer;getPosition(Lcom/google/gson/stream/JsonReader;)I
-