Package net.minecraftforge.registries
Record Class GameData.WrapperFactory<V>
java.lang.Object
java.lang.Record
net.minecraftforge.registries.GameData.WrapperFactory<V>
- All Implemented Interfaces:
IForgeRegistry.AddCallback<V>
,IForgeRegistry.CreateCallback<V>
- Enclosing class:
GameData
static record GameData.WrapperFactory<V>(BiFunction<ForgeRegistry<V>,RegistryManager,WritableRegistry<V>> factory)
extends Record
implements IForgeRegistry.CreateCallback<V>, IForgeRegistry.AddCallback<V>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BiFunction
<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> The field for thefactory
record component.(package private) static IForgeRegistry.SlaveKey
<WritableRegistry<?>> -
Constructor Summary
ConstructorDescriptionWrapperFactory
(BiFunction<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> factory) Creates an instance of aWrapperFactory
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.factory()
Returns the value of thefactory
record component.final int
hashCode()
Returns a hash code value for this object.void
onAdd
(IForgeRegistryInternal<V> owner, RegistryManager stage, int id, ResourceKey<V> key, V value, V oldValue) void
onCreate
(IForgeRegistryInternal<V> owner, RegistryManager stage) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
factory
The field for thefactory
record component. -
WRAPPER
-
-
Constructor Details
-
WrapperFactory
WrapperFactory(BiFunction<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> factory) Creates an instance of aWrapperFactory
record class.- Parameters:
factory
- the value for thefactory
record component
-
-
Method Details
-
onCreate
- Specified by:
onCreate
in interfaceIForgeRegistry.CreateCallback<V>
-
onAdd
public void onAdd(IForgeRegistryInternal<V> owner, RegistryManager stage, int id, ResourceKey<V> key, V value, V oldValue) - Specified by:
onAdd
in interfaceIForgeRegistry.AddCallback<V>
-
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)
. -
factory
Returns the value of thefactory
record component.- Returns:
- the value of the
factory
record component
-