Record Class RegistryList
java.lang.Object
java.lang.Record
net.minecraftforge.network.packets.RegistryList
public record RegistryList(int token, List<ResourceLocation> normal, List<ResourceKey<? extends Registry<?>>> datapacks)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<ResourceKey<? extends Registry<?>>> The field for thedatapacks
record component.private final List
<ResourceLocation> The field for thenormal
record component.static final StreamCodec
<FriendlyByteBuf, RegistryList> private final int
The field for thetoken
record component. -
Constructor Summary
ConstructorDescriptionRegistryList
(int token) RegistryList
(int token, List<ResourceLocation> normal, List<ResourceKey<? extends Registry<?>>> datapacks) Creates an instance of aRegistryList
record class. -
Method Summary
Modifier and TypeMethodDescriptionList
<ResourceKey<? extends Registry<?>>> Returns the value of thedatapacks
record component.static RegistryList
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.normal()
Returns the value of thenormal
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. -
normal
The field for thenormal
record component. -
datapacks
The field for thedatapacks
record component. -
STREAM_CODEC
-
-
Constructor Details
-
RegistryList
public RegistryList(int token) -
RegistryList
public RegistryList(int token, List<ResourceLocation> normal, List<ResourceKey<? extends Registry<?>>> datapacks) Creates an instance of aRegistryList
record class.- Parameters:
token
- the value for thetoken
record componentnormal
- the value for thenormal
record componentdatapacks
- the value for thedatapacks
record component
-
-
Method Details
-
decode
-
encode
-
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
-
normal
Returns the value of thenormal
record component.- Returns:
- the value of the
normal
record component
-
datapacks
Returns the value of thedatapacks
record component.- Returns:
- the value of the
datapacks
record component
-