Interface SimpleRegistry.Multi<K,V>

All Superinterfaces:
SimpleRegistry<K,List<V>>
Enclosing interface:
SimpleRegistry<K,V>

public static interface SimpleRegistry.Multi<K,V> extends SimpleRegistry<K,List<V>>
An extension of SimpleRegistry that handles multiple registrations per object. SimpleRegistry.register(Object, Object) Will set a whole list of registrations - use add(Object, Object) to add one. Here, all Providers are always queried, and all of their results are returned. Their provided values are also provided on top of explicit registrations - they do not take priority.
  • Method Details

    • add

      void add(K object, V value)
    • addProvider

      void addProvider(SimpleRegistry.Provider<K,V> provider)
      Shortcut that wraps a single-value provider into one that provides a List.
    • get

      @NotNull @NotNull List<V> get(K object)
      Never returns null, will return an empty list if no registrations are present
      Specified by:
      get in interface SimpleRegistry<K,V>
    • get

      @NotNull @NotNull List<V> get(net.minecraft.world.level.block.state.StateHolder<K,?> state)
      Never returns null, will return an empty list if no registrations are present
      Specified by:
      get in interface SimpleRegistry<K,V>
    • create

      static <K, V> SimpleRegistry.Multi<K,V> create()