Interface WritableRegistry<T,B extends RegistryBuilder<T>>

Type Parameters:
T - registry entry type
B - registry entry builder type

@NonExtendable @Experimental public interface WritableRegistry<T,B extends RegistryBuilder<T>>
A registry which supports registering new objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(@NonNull TypedKey<T> key, @NonNull Consumer<? super B> value)
    Register a new value with the specified key.
  • Method Details

    • register

      void register(@NonNull TypedKey<T> key, @NonNull Consumer<? super B> value)
      Register a new value with the specified key. This will fire a RegistryEntryAddEvent for the new entry.
      Parameters:
      key - the entry's key (must be unique from others)
      value - a consumer for the entry's builder