Interface IForgeRegistry<V extends IForgeRegistryEntry<V>>

Type Parameters:
V - The top level type for the registry
All Superinterfaces:
Iterable<V>
All Known Subinterfaces:
IForgeRegistryInternal<V>, IForgeRegistryModifiable<V>
All Known Implementing Classes:
ForgeRegistry

public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterable<V>
Main interface for the registry system. Use this to query the registry system.
  • Method Details

    • getRegistryKey

      ResourceKey<Registry<V>> getRegistryKey()
    • getRegistryName

      ResourceLocation getRegistryName()
    • getRegistrySuperType

      Class<V> getRegistrySuperType()
    • register

      void register(V value)
    • registerAll

      void registerAll(V... values)
    • containsKey

      boolean containsKey(ResourceLocation key)
    • containsValue

      boolean containsValue(V value)
    • isEmpty

      boolean isEmpty()
    • getValue

      @Nullable V getValue(ResourceLocation key)
    • getKey

      @Nullable @Nullable ResourceLocation getKey(V value)
    • getDefaultKey

      @Nullable @Nullable ResourceLocation getDefaultKey()
    • getResourceKey

      @NotNull @NotNull Optional<ResourceKey<V>> getResourceKey(V value)
    • getKeys

      @NotNull @NotNull Set<ResourceLocation> getKeys()
    • getValues

      @NotNull @NotNull Collection<V> getValues()
    • getEntries

      @NotNull @NotNull Set<Map.Entry<ResourceKey<V>,V>> getEntries()
    • getCodec

      @NotNull @NotNull com.mojang.serialization.Codec<V> getCodec()
      See Also:
    • getHolder

      @NotNull @NotNull Optional<Holder<V>> getHolder(ResourceKey<V> key)
      This method exists purely as a stopgap for vanilla compatibility. For anything tag related, use tags().
      See Also:
    • getHolder

      @NotNull @NotNull Optional<Holder<V>> getHolder(ResourceLocation location)
      This method exists purely as a stopgap for vanilla compatibility. For anything tag related, use tags().
    • getHolder

      @NotNull @NotNull Optional<Holder<V>> getHolder(V value)
      This method exists purely as a stopgap for vanilla compatibility. For anything tag related, use tags().
    • tags

      @Nullable @Nullable ITagManager<V> tags()
      Returns:
      an instance of ITagManager if this registry supports tags and/or has a wrapper registry, null otherwise
    • getSlaveMap

      <T> T getSlaveMap(ResourceLocation slaveMapName, Class<T> type)
      Retrieve the slave map of type T from the registry. Slave maps are maps which are dependent on registry content in some way.
      Type Parameters:
      T - Type to return
      Parameters:
      slaveMapName - The name of the slavemap
      type - The type
      Returns:
      The slavemap if present