Interface IExtensibleEnum

    • Method Summary

      All Methods Static Methods Instance Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      static <E extends java.lang.Enum<E> & IStringSerializable>
      com.mojang.serialization.Codec<E>
      createCodecForExtensibleEnum​(java.util.function.Supplier<E[]> valuesSupplier, java.util.function.Function<? super java.lang.String,​? extends E> enumValueFromNameFunction)
      Use this instead of IStringSerializable#createEnumCodec(Supplier, Function) for extensible enums because this not cache the enum values on construction
      default void init()
      Deprecated.
    • Method Detail

      • init

        @Deprecated
        default void init()
        Deprecated.
        Called by generated factory code to do any post-constructor setup required by the enum. Should not be called manually.
      • createCodecForExtensibleEnum

        static <E extends java.lang.Enum<E> & IStringSerializable> com.mojang.serialization.Codec<E> createCodecForExtensibleEnum​(java.util.function.Supplier<E[]> valuesSupplier,
                                                                                                                                  java.util.function.Function<? super java.lang.String,​? extends E> enumValueFromNameFunction)
        Use this instead of IStringSerializable#createEnumCodec(Supplier, Function) for extensible enums because this not cache the enum values on construction