Package net.minecraft.text
Class Text.Serializer
java.lang.Object
net.minecraft.text.Text.Serializer
- All Implemented Interfaces:
JsonDeserializer<MutableText>,JsonSerializer<Text>
- Enclosing interface:
Text
public static class Text.Serializer
extends Object
implements JsonDeserializer<MutableText>, JsonSerializer<Text>
A JSON serializer for
Text.- Mappings:
Namespace Name official si$aintermediary net/minecraft/class_2561$class_2562named net/minecraft/text/Text$Serializer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddSeparator(JsonSerializationContext context, JsonObject json, Optional<Text> separator) private voidaddStyle(Style style, JsonObject json, JsonSerializationContext context) static @Nullable MutableTextfromJson(JsonElement json) static MutableTextfromJson(com.mojang.brigadier.StringReader reader) static @Nullable MutableTextstatic @Nullable MutableTextfromLenientJson(String json) private static intgetPosition(JsonReader reader) getSeparator(Type type, JsonDeserializationContext context, JsonObject json) method_10871(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) method_10874(Text text, Type type, JsonSerializationContext jsonSerializationContext) private static ObjectoptimizeArgument(Object text) static Stringstatic JsonElementtoJsonTree(Text text) static StringtoSortedJsonString(Text text) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gson.JsonDeserializer
deserializeMethods inherited from interface com.google.gson.JsonSerializer
serialize
-
Field Details
-
GSON
- Mappings:
Namespace Name Mixin selector official aLsi$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 bLsi$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 cLsi$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
-
method_10871
public MutableText method_10871(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException - Throws:
JsonParseException- Mappings:
Namespace Name Mixin selector official aLsi$a;a(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lsv;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 method_10871Lnet/minecraft/text/Text$Serializer;method_10871(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/text/MutableText;
-
optimizeArgument
- Mappings:
Namespace Name Mixin selector official aLsi$a;a(Ljava/lang/Object;)Ljava/lang/Object;intermediary method_43474Lnet/minecraft/class_2561$class_2562;method_43474(Ljava/lang/Object;)Ljava/lang/Object;named optimizeArgumentLnet/minecraft/text/Text$Serializer;optimizeArgument(Ljava/lang/Object;)Ljava/lang/Object;
-
getSeparator
- Mappings:
Namespace Name Mixin selector official aLsi$a;a(Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;Lcom/google/gson/JsonObject;)Ljava/util/Optional;intermediary method_36329Lnet/minecraft/class_2561$class_2562;method_36329(Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;Lcom/google/gson/JsonObject;)Ljava/util/Optional;named getSeparatorLnet/minecraft/text/Text$Serializer;getSeparator(Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;Lcom/google/gson/JsonObject;)Ljava/util/Optional;
-
addStyle
- Mappings:
Namespace Name Mixin selector official aLsi$a;a(Lte;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
-
method_10874
public JsonElement method_10874(Text text, Type type, JsonSerializationContext jsonSerializationContext) - Mappings:
Namespace Name Mixin selector official aLsi$a;a(Lsi;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 method_10874Lnet/minecraft/text/Text$Serializer;method_10874(Lnet/minecraft/text/Text;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
-
addSeparator
private void addSeparator(JsonSerializationContext context, JsonObject json, Optional<Text> separator) - Mappings:
Namespace Name Mixin selector official aLsi$a;a(Lcom/google/gson/JsonSerializationContext;Lcom/google/gson/JsonObject;Ljava/util/Optional;)Vintermediary method_36328Lnet/minecraft/class_2561$class_2562;method_36328(Lcom/google/gson/JsonSerializationContext;Lcom/google/gson/JsonObject;Ljava/util/Optional;)Vnamed addSeparatorLnet/minecraft/text/Text$Serializer;addSeparator(Lcom/google/gson/JsonSerializationContext;Lcom/google/gson/JsonObject;Ljava/util/Optional;)V
-
toJson
- Mappings:
Namespace Name Mixin selector official aLsi$a;a(Lsi;)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;
-
toSortedJsonString
- Mappings:
Namespace Name Mixin selector official bLsi$a;b(Lsi;)Ljava/lang/String;intermediary method_43858Lnet/minecraft/class_2561$class_2562;method_43858(Lnet/minecraft/class_2561;)Ljava/lang/String;named toSortedJsonStringLnet/minecraft/text/Text$Serializer;toSortedJsonString(Lnet/minecraft/text/Text;)Ljava/lang/String;
-
toJsonTree
- Mappings:
Namespace Name Mixin selector official cLsi$a;c(Lsi;)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 aLsi$a;a(Ljava/lang/String;)Lsv;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 aLsi$a;a(Lcom/google/gson/JsonElement;)Lsv;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 bLsi$a;b(Ljava/lang/String;)Lsv;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 aLsi$a;a(Lcom/mojang/brigadier/StringReader;)Lsv;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
- Mappings:
Namespace Name Mixin selector official aLsi$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
-