Record Class FrozenRegistryPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.FrozenRegistryPayload
- Record Components:
registryName
- The name of the registrysnapshot
- The snapshot of the registry
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record FrozenRegistryPayload(ResourceLocation registryName, RegistrySnapshot snapshot)
extends Record
implements CustomPacketPayload
Packet payload for sending a frozen registry to the client
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
CustomPacketPayload.FallbackProvider<B extends FriendlyByteBuf>, CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends FriendlyByteBuf,
T extends CustomPacketPayload> -
Field Summary
Modifier and TypeFieldDescriptionprivate final ResourceLocation
The field for theregistryName
record component.private final RegistrySnapshot
The field for thesnapshot
record component.static final StreamCodec
<FriendlyByteBuf, FrozenRegistryPayload> static final CustomPacketPayload.Type
<FrozenRegistryPayload> -
Constructor Summary
ConstructorDescriptionFrozenRegistryPayload
(ResourceLocation registryName, RegistrySnapshot snapshot) Creates an instance of aFrozenRegistryPayload
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 theregistryName
record component.snapshot()
Returns the value of thesnapshot
record component.final String
toString()
Returns a string representation of this record class.type()
-
Field Details
-
registryName
The field for theregistryName
record component. -
snapshot
The field for thesnapshot
record component. -
TYPE
-
STREAM_CODEC
-
-
Constructor Details
-
FrozenRegistryPayload
Creates an instance of aFrozenRegistryPayload
record class.- Parameters:
registryName
- the value for theregistryName
record componentsnapshot
- the value for thesnapshot
record component
-
-
Method Details
-
type
- Specified by:
type
in interfaceCustomPacketPayload
-
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)
. -
registryName
Returns the value of theregistryName
record component.- Returns:
- the value of the
registryName
record component
-
snapshot
Returns the value of thesnapshot
record component.- Returns:
- the value of the
snapshot
record component
-