Class ResourceLocationTypeAdapter

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.species.typeadapters.ResourceLocationTypeAdapter
All Implemented Interfaces:
com.google.gson.JsonDeserializer<net.minecraft.resources.ResourceLocation>, com.google.gson.JsonSerializer<net.minecraft.resources.ResourceLocation>

public class ResourceLocationTypeAdapter extends Object implements com.google.gson.JsonSerializer<net.minecraft.resources.ResourceLocation>, com.google.gson.JsonDeserializer<net.minecraft.resources.ResourceLocation>
Gson type TypeAdapter for the ResourceLocation class such that it can be converted to and from Json text when loading to/from Species data.
  • Constructor Details

    • ResourceLocationTypeAdapter

      public ResourceLocationTypeAdapter()
  • Method Details

    • deserialize

      public net.minecraft.resources.ResourceLocation deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
      Specified by:
      deserialize in interface com.google.gson.JsonDeserializer<net.minecraft.resources.ResourceLocation>
      Throws:
      com.google.gson.JsonParseException
    • serialize

      public com.google.gson.JsonElement serialize(net.minecraft.resources.ResourceLocation src, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<net.minecraft.resources.ResourceLocation>