Record Class RegistryData
java.lang.Object
java.lang.Record
net.minecraftforge.network.packets.RegistryData
public record RegistryData(int token, ResourceLocation name, ForgeRegistry.Snapshot data)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ForgeRegistry.Snapshot
The field for thedata
record component.private final ResourceLocation
The field for thename
record component.private final int
The field for thetoken
record component. -
Constructor Summary
ConstructorDescriptionRegistryData
(int token, ResourceLocation name, ForgeRegistry.Snapshot data) Creates an instance of aRegistryData
record class. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.static RegistryData
decode
(FriendlyByteBuf buf) void
encode
(FriendlyByteBuf buf) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.int
token()
Returns the value of thetoken
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
token
private final int tokenThe field for thetoken
record component. -
name
The field for thename
record component. -
data
The field for thedata
record component.
-
-
Constructor Details
-
RegistryData
Creates an instance of aRegistryData
record class.- Parameters:
token
- the value for thetoken
record componentname
- the value for thename
record componentdata
- the value for thedata
record component
-
-
Method Details
-
encode
-
decode
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
token
public int token()Returns the value of thetoken
record component.- Returns:
- the value of the
token
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-