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 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 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 interface com.google.gson.JsonDeserializer<MutableComponent>
      Throws:
      com.google.gson.JsonParseException
    • unwrapTextArgument

      private static Object unwrapTextArgument(Object p_237121_)
    • parseSeparator

      private Optional<Component> parseSeparator(Type p_178416_, com.google.gson.JsonDeserializationContext p_178417_, com.google.gson.JsonObject p_178418_)
    • 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 interface com.google.gson.JsonSerializer<Component>
    • serializeSeparator

      private void serializeSeparator(com.google.gson.JsonSerializationContext p_178412_, com.google.gson.JsonObject p_178413_, Optional<Component> p_178414_)
    • toJson

      public static String toJson(Component p_130704_)
    • toStableJson

      public static String toStableJson(Component p_237123_)
    • toJsonTree

      public static com.google.gson.JsonElement toJsonTree(Component p_130717_)
    • fromJson

      @Nullable public static MutableComponent fromJson(String p_130702_)
    • fromJson

      @Nullable public static MutableComponent fromJson(com.google.gson.JsonElement p_130692_)
    • fromJsonLenient

      @Nullable public static MutableComponent fromJsonLenient(String p_130715_)
    • fromJson

      public static MutableComponent fromJson(com.mojang.brigadier.StringReader p_130700_)
    • getPos

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