Class EnumObjects<E extends Enum<E>,T>

java.lang.Object
org.moddingx.libx.registration.util.EnumObjects<E,T>
Type Parameters:
E - The type of the enum to use.
T - The type of the thing to register.
All Implemented Interfaces:
Registerable

@PlainRegisterable public final class EnumObjects<E extends Enum<E>,T> extends Object implements Registerable
A Registerable that registers multiple objects, one for each value of an enum. This is done via Registerable.registerAdditional(RegistrationContext, EntryCollector) so the enum names will be applied automatically.
  • Constructor Details

    • EnumObjects

      public EnumObjects(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, Class<E> cls, Function<E,T> factory)
      Creates a new instance of EnumObjects.
      Parameters:
      registryKey - The registry to register to.
      cls - The class of the enum that is used. The enum must have at least one value.
      factory - A factory function that creates the objects to be registered.
  • Method Details