Class Codecs

java.lang.Object
org.moddingx.libx.annotation.api.Codecs

public class Codecs extends Object
Class to retrieve generated codecs. They should normally be assigned to a public static final field in the class that the codec is for.
  • Constructor Details

    • Codecs

      public Codecs()
  • Method Details

    • get

      public static <T> com.mojang.serialization.Codec<T> get(Class<? extends ModX> mod, Class<T> clazz)
      Gets a codec created by the use of the PrimaryConstructor annotation. Should be assigned to a public static final field named CODEC in the same file.
      Parameters:
      mod - Your mods' class
      clazz - The class of which the codec was created