Package team.lodestar.lodestone.helpers
Class CodecHelper
java.lang.Object
team.lodestar.lodestone.helpers.CodecHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,B> T decodeOrThrow(com.mojang.serialization.DynamicOps<B> source, com.mojang.serialization.Codec<T> codec, B value) static <T,B> B encodeOrThrow(com.mojang.serialization.DynamicOps<B> target, com.mojang.serialization.Codec<T> codec, T value) static <T,B> void overwriteExisting(com.mojang.serialization.DynamicOps<B> source, com.mojang.serialization.Codec<T> codec, B value, T target) Overwrites the fields of the target object with the fields of the source object.
-
Constructor Details
-
CodecHelper
public CodecHelper()
-
-
Method Details
-
encodeOrThrow
public static <T,B> B encodeOrThrow(com.mojang.serialization.DynamicOps<B> target, com.mojang.serialization.Codec<T> codec, T value) -
decodeOrThrow
public static <T,B> T decodeOrThrow(com.mojang.serialization.DynamicOps<B> source, com.mojang.serialization.Codec<T> codec, B value) -
overwriteExisting
public static <T,B> void overwriteExisting(com.mojang.serialization.DynamicOps<B> source, com.mojang.serialization.Codec<T> codec, B value, T target) Overwrites the fields of the target object with the fields of the source object. If the target contains fields that the source does not, they will be left unchanged.
-