Class ThermooCodecs

java.lang.Object
com.github.thedeathlycow.thermoo.api.ThermooCodecs

@Experimental public final class ThermooCodecs extends Object
Helpful codecs used by Thermoo. May be changed between MC versions as equivalent vanilla codecs are added.

Exposed in API for the convenience of API users.

  • Method Details

    • createEnumCodec

      public static <E extends Enum<E>> com.mojang.serialization.Codec<E> createEnumCodec(Class<E> clazz)
      Creates a codec for an Enum. Either uses the enum ordinal or the name, but prefers the ordinal for more efficient storage.
      Type Parameters:
      E - The enum type
      Parameters:
      clazz - The class of the enum.
      Returns:
      Returns a codec for the enum class