接口 IForgeRegistry<V>

类型参数:
V - The top level type for the registry
所有超级接口:
Iterable<V>
所有已知子接口:
IForgeRegistryInternal<V>, IForgeRegistryModifiable<V>
所有已知实现类:
ForgeRegistry

public interface IForgeRegistry<V> extends Iterable<V>
Main interface for the registry system. Use this to query the registry system.
  • 方法详细资料

    • getRegistryKey

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

      ResourceLocation getRegistryName()
    • register

      void register(String key, V value)
      The supplied string key will be prefixed with the currently active mod's mod id. If the supplied name already has a prefix that is different, it will be used and a warning will be logged.
    • register

      void register(ResourceLocation key, V value)
    • 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()
      另请参阅:
    • 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().
      另请参阅:
    • 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()
      返回:
      an instance of ITagManager if this registry supports tags and/or has a wrapper registry, null otherwise
    • getDelegate

      @NotNull @NotNull Optional<Holder.Reference<V>> getDelegate(ResourceKey<V> rkey)
    • getDelegateOrThrow

      @NotNull Holder.Reference<V> getDelegateOrThrow(ResourceKey<V> rkey)
    • getDelegate

      @NotNull @NotNull Optional<Holder.Reference<V>> getDelegate(ResourceLocation key)
    • getDelegateOrThrow

      @NotNull Holder.Reference<V> getDelegateOrThrow(ResourceLocation key)
    • getDelegate

      @NotNull @NotNull Optional<Holder.Reference<V>> getDelegate(V value)
    • getDelegateOrThrow

      @NotNull Holder.Reference<V> getDelegateOrThrow(V value)
    • 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.
      类型参数:
      T - Type to return
      参数:
      slaveMapName - The name of the slavemap
      type - The type
      返回:
      The slavemap if present
    • addAlias

      void addAlias(ResourceLocation src, ResourceLocation dst)
      Adds an alias that maps from the name specified by src to the name specified by dst.

      Any registry lookups that target the first name will resolve as the second name, if the first name is not present.

      参数:
      src - The source registry name to alias from.
      dst - The target registry name to alias to.