Package net.minecraftforge.registries
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
Main interface for the registry system. Use this to query the registry system.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIForgeRegistry.AddCallback<V extends IForgeRegistryEntry<V>>Callback fired when objects are added to the registry.static interfaceIForgeRegistry.BakeCallback<V extends IForgeRegistryEntry<V>>Callback fired when the registry is done processing.static interfaceIForgeRegistry.ClearCallback<V extends IForgeRegistryEntry<V>>Callback fired when the registry is cleared.static interfaceIForgeRegistry.CreateCallback<V extends IForgeRegistryEntry<V>>Callback fired when a registry instance is created.static interfaceIForgeRegistry.DummyFactory<V extends IForgeRegistryEntry<V>>Factory for creating dummy entries, allowing worlds to be loaded and keep the missing block references.static interfaceIForgeRegistry.MissingFactory<V extends IForgeRegistryEntry<V>>static interfaceIForgeRegistry.ValidateCallback<V extends IForgeRegistryEntry<V>>Callback fired when the registry contents are validated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancontainsValue(V value) @NotNull com.mojang.serialization.Codec<V>getCodec()@Nullable ResourceLocation@NotNull Set<Map.Entry<ResourceKey<V>,V>> getHolder(ResourceKey<V> key) This method exists purely as a stopgap for vanilla compatibility.getHolder(ResourceLocation location) This method exists purely as a stopgap for vanilla compatibility.This method exists purely as a stopgap for vanilla compatibility.@Nullable ResourceLocation@NotNull Set<ResourceLocation>getKeys()@NotNull Optional<ResourceKey<V>>getResourceKey(V value) <T> TgetSlaveMap(ResourceLocation slaveMapName, Class<T> type) Retrieve the slave map of type T from the registry.getValue(ResourceLocation key) @NotNull Collection<V>booleanisEmpty()voidvoidregisterAll(V... values) @Nullable ITagManager<V>tags()Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getRegistryKey
ResourceKey<Registry<V>> getRegistryKey() -
getRegistryName
ResourceLocation getRegistryName() -
getRegistrySuperType
-
register
-
registerAll
-
containsKey
-
containsValue
-
isEmpty
boolean isEmpty() -
getValue
-
getKey
-
getDefaultKey
-
getResourceKey
-
getKeys
-
getValues
-
getEntries
-
getCodec
- See Also:
-
getHolder
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, usetags().- See Also:
-
getHolder
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, usetags(). -
getHolder
This method exists purely as a stopgap for vanilla compatibility. For anything tag related, usetags(). -
tags
- Returns:
- an instance of
ITagManagerif this registry supports tags and/or has a wrapper registry, null otherwise
-
getSlaveMap
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 slavemaptype- The type- Returns:
- The slavemap if present
-