Class GsonSerializableCodecs

java.lang.Object
com.petrolpark.network.GsonSerializableCodecs

public class GsonSerializableCodecs extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<net.minecraft.world.level.storage.loot.providers.number.NumberProvider>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static <U> com.google.gson.JsonElement
    getJson(com.mojang.serialization.Dynamic<?> dynamic)
     
    static <GSON_SERIALIZABLE_OBJECT>
    com.mojang.serialization.Codec<GSON_SERIALIZABLE_OBJECT>
    GSONserializableCodec(String name, Class<GSON_SERIALIZABLE_OBJECT> jsonSerializableObjectClass, com.google.gson.Gson gson)
    Construct a Codec for a class that has a defined JSON Serializer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NUMBER_PROVIDER

      public static final com.mojang.serialization.Codec<net.minecraft.world.level.storage.loot.providers.number.NumberProvider> NUMBER_PROVIDER
  • Constructor Details

    • GsonSerializableCodecs

      public GsonSerializableCodecs()
  • Method Details

    • GSONserializableCodec

      public static <GSON_SERIALIZABLE_OBJECT> com.mojang.serialization.Codec<GSON_SERIALIZABLE_OBJECT> GSONserializableCodec(String name, Class<GSON_SERIALIZABLE_OBJECT> jsonSerializableObjectClass, com.google.gson.Gson gson)
      Construct a Codec for a class that has a defined JSON Serializer.
      Parameters:
      name - Name of class to show in error messages
      jsonSerializableObjectClass -
      gson - Must be capable of (de)serializing objects of the given class.
      See Also:
      • Examples of such GSONs
    • getJson

      protected static <U> com.google.gson.JsonElement getJson(com.mojang.serialization.Dynamic<?> dynamic)