Class ITextComponent.Serializer

java.lang.Object
net.minecraft.util.text.ITextComponent.Serializer
All Implemented Interfaces:
com.google.gson.JsonDeserializer<IFormattableTextComponent>, com.google.gson.JsonSerializer<ITextComponent>
Enclosing interface:
ITextComponent

public static class ITextComponent.Serializer extends Object implements com.google.gson.JsonDeserializer<IFormattableTextComponent>, com.google.gson.JsonSerializer<ITextComponent>
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
    • JSON_READER_POS

      private static final Field JSON_READER_POS
    • JSON_READER_LINESTART

      private static final Field JSON_READER_LINESTART
  • Constructor Details

    • Serializer

      public Serializer()
  • Method Details

    • deserialize

      public IFormattableTextComponent deserialize(com.google.gson.JsonElement p_deserialize_1_, Type p_deserialize_2_, com.google.gson.JsonDeserializationContext p_deserialize_3_) throws com.google.gson.JsonParseException
      Specified by:
      deserialize in interface com.google.gson.JsonDeserializer<IFormattableTextComponent>
      Throws:
      com.google.gson.JsonParseException
    • serializeStyle

      private void serializeStyle(Style p_150695_1_, com.google.gson.JsonObject p_150695_2_, com.google.gson.JsonSerializationContext p_150695_3_)
    • serialize

      public com.google.gson.JsonElement serialize(ITextComponent p_serialize_1_, Type p_serialize_2_, com.google.gson.JsonSerializationContext p_serialize_3_)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<ITextComponent>
    • toJson

      public static String toJson(ITextComponent p_150696_0_)
    • toJsonTree

      public static com.google.gson.JsonElement toJsonTree(ITextComponent p_200528_0_)
    • fromJson

      @Nullable public static IFormattableTextComponent fromJson(String p_240643_0_)
    • fromJson

      @Nullable public static IFormattableTextComponent fromJson(com.google.gson.JsonElement p_240641_0_)
    • fromJsonLenient

      @Nullable public static IFormattableTextComponent fromJsonLenient(String p_240644_0_)
    • fromJson

      public static IFormattableTextComponent fromJson(com.mojang.brigadier.StringReader p_240642_0_)
    • getPos

      private static int getPos(com.google.gson.stream.JsonReader p_197673_0_)