Package com.petrolpark.network
Class GsonSerializableCodecs
java.lang.Object
com.petrolpark.network.GsonSerializableCodecs
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.world.level.storage.loot.providers.number.NumberProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <U> com.google.gson.JsonElementgetJson(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 JSONSerializer.
-
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 JSONSerializer.- Parameters:
name- Name of class to show in error messagesjsonSerializableObjectClass-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)
-