Class CodecUtil

java.lang.Object
foundry.veil.api.util.CodecUtil

public class CodecUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    static <T> com.mojang.serialization.Codec<List<T>>
    singleOrList(com.mojang.serialization.Codec<T> codec)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)