Package foundry.veil.api.util
Class CodecUtil
java.lang.Object
foundry.veil.api.util.CodecUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<org.joml.Vector2fc> static final com.mojang.serialization.Codec
<org.joml.Vector3dc> static final com.mojang.serialization.Codec
<org.joml.Vector3fc> static final com.mojang.serialization.Codec
<org.joml.Vector4fc> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.serialization.Codec
<T> registryOrLegacyCodec
(net.minecraft.core.Registry<T> registry) Creates a codec which can accept either resource locations like `veil:cube` but also accepts legacy-style names like `CUBE` (used when things used to be enums, but are now registries)static <T> com.mojang.serialization.Codec
<List<T>> singleOrList
(com.mojang.serialization.Codec<T> codec)
-
Field Details
-
VECTOR2F_CODEC
public static final com.mojang.serialization.Codec<org.joml.Vector2fc> VECTOR2F_CODEC -
VECTOR3F_CODEC
public static final com.mojang.serialization.Codec<org.joml.Vector3fc> VECTOR3F_CODEC -
VECTOR4F_CODEC
public static final com.mojang.serialization.Codec<org.joml.Vector4fc> VECTOR4F_CODEC -
VECTOR3D_CODEC
public static final com.mojang.serialization.Codec<org.joml.Vector3dc> VECTOR3D_CODEC
-
-
Constructor Details
-
CodecUtil
public CodecUtil()
-
-
Method Details
-
singleOrList
public static <T> com.mojang.serialization.Codec<List<T>> singleOrList(com.mojang.serialization.Codec<T> codec) -
registryOrLegacyCodec
public static <T> com.mojang.serialization.Codec<T> registryOrLegacyCodec(net.minecraft.core.Registry<T> registry) Creates a codec which can accept either resource locations like `veil:cube` but also accepts legacy-style names like `CUBE` (used when things used to be enums, but are now registries)
-