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
FieldsModifier and TypeFieldDescriptionprivate final BiFunction<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> The field for thefactoryrecord component.(package private) static IForgeRegistry.SlaveKey<WritableRegistry<?>> -
Constructor Summary
ConstructorsConstructorDescriptionWrapperFactory(BiFunction<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> factory) Creates an instance of aWrapperFactoryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.factory()Returns the value of thefactoryrecord component.final inthashCode()Returns a hash code value for this object.voidonAdd(IForgeRegistryInternal<V> owner, RegistryManager stage, int id, ResourceKey<V> key, V value, V oldValue) voidonCreate(IForgeRegistryInternal<V> owner, RegistryManager stage) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
factory
The field for thefactoryrecord component. -
WRAPPER
-
-
Constructor Details
-
WrapperFactory
WrapperFactory(BiFunction<ForgeRegistry<V>, RegistryManager, WritableRegistry<V>> factory) Creates an instance of aWrapperFactoryrecord class.- Parameters:
factory- the value for thefactoryrecord component
-
-
Method Details
-
onCreate
- Specified by:
onCreatein interfaceIForgeRegistry.CreateCallback<V>
-
onAdd
public void onAdd(IForgeRegistryInternal<V> owner, RegistryManager stage, int id, ResourceKey<V> key, V value, V oldValue) - Specified by:
onAddin 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 thefactoryrecord component.- Returns:
- the value of the
factoryrecord component
-