Record Class DynamicRegistryManagerSetupContext.RegistryMap
java.lang.Object
java.lang.Record
org.quiltmc.qsl.frozenblock.core.registry.api.event.DynamicRegistryManagerSetupContext.RegistryMap
- Record Components:
registries- the map of registries
- Enclosing interface:
DynamicRegistryManagerSetupContext
public static record DynamicRegistryManagerSetupContext.RegistryMap(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>,net.minecraft.core.Registry<?>> registries)
extends Record
Represents a map of known registries.
-
Constructor Summary
ConstructorsConstructorDescriptionRegistryMap(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.core.Registry<?>> registries) Creates an instance of aRegistryMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.<V> net.minecraft.core.Registry<V> get(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<V>> registryKey) Gets the registry from its key in this map.final inthashCode()Returns a hash code value for this object.<V> Vregister(@NotNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<V>> registryKey, @NotNull net.minecraft.resources.ResourceLocation id, V gameObject) Registers the given game object into the given registry.Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.core.Registry<?>> Returns the value of theregistriesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RegistryMap
public RegistryMap(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.core.Registry<?>> registries) Creates an instance of aRegistryMaprecord class.- Parameters:
registries- the value for theregistriesrecord component
-
-
Method Details
-
get
@Contract(pure=true) public <V> net.minecraft.core.Registry<V> get(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<V>> registryKey) Gets the registry from its key in this map.- Type Parameters:
V- the type of values held in the registry- Parameters:
registryKey- the key of the registry- Returns:
- the registry if present, or
nullotherwise
-
register
@NotNull public <V> V register(@NotNull @NotNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<V>> registryKey, @NotNull @NotNull net.minecraft.resources.ResourceLocation id, @NotNull V gameObject) Registers the given game object into the given registry.- Type Parameters:
V- the type of values held in the registry- Parameters:
registryKey- the key of the registry to register intoid- the identifier of the game object to registergameObject- the game object to register- Returns:
- the game object
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
registries
public Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>,net.minecraft.core.Registry<?>> registries()Returns the value of theregistriesrecord component.- Returns:
- the value of the
registriesrecord component
-