Package net.minecraftforge.registries
Record Class DataPackRegistryEvent.DataPackRegistryData<T>
java.lang.Object
java.lang.Record
net.minecraftforge.registries.DataPackRegistryEvent.DataPackRegistryData<T>
- Enclosing class:
- DataPackRegistryEvent
static record DataPackRegistryEvent.DataPackRegistryData<T>(RegistryDataLoader.RegistryData<T> loaderData, @Nullable com.mojang.serialization.Codec<T> networkCodec)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final RegistryDataLoader.RegistryData<T>
The field for theloaderData
record component.private final @Nullable com.mojang.serialization.Codec<T>
The field for thenetworkCodec
record component. -
Constructor Summary
ConstructorDescriptionDataPackRegistryData
(RegistryDataLoader.RegistryData<T> loaderData, @Nullable com.mojang.serialization.Codec<T> networkCodec) Creates an instance of aDataPackRegistryData
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theloaderData
record component.@Nullable com.mojang.serialization.Codec<T>
Returns the value of thenetworkCodec
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
loaderData
The field for theloaderData
record component. -
networkCodec
The field for thenetworkCodec
record component.
-
-
Constructor Details
-
DataPackRegistryData
DataPackRegistryData(RegistryDataLoader.RegistryData<T> loaderData, @Nullable @Nullable com.mojang.serialization.Codec<T> networkCodec) Creates an instance of aDataPackRegistryData
record class.- Parameters:
loaderData
- the value for theloaderData
record componentnetworkCodec
- the value for thenetworkCodec
record component
-
-
Method Details
-
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)
. -
loaderData
Returns the value of theloaderData
record component.- Returns:
- the value of the
loaderData
record component
-
networkCodec
Returns the value of thenetworkCodec
record component.- Returns:
- the value of the
networkCodec
record component
-