Record Class SyncAttachmentsPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.SyncAttachmentsPayload
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record SyncAttachmentsPayload(SyncAttachmentsPayload.Target target, List<AttachmentType<?>> types, byte[] syncPayload)
extends Record
implements CustomPacketPayload
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
static final record
static final record
static interface
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
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec
<RegistryFriendlyByteBuf, SyncAttachmentsPayload> private final byte[]
The field for thesyncPayload
record component.private final SyncAttachmentsPayload.Target
The field for thetarget
record component.static final CustomPacketPayload.Type
<SyncAttachmentsPayload> private final List
<AttachmentType<?>> The field for thetypes
record component. -
Constructor Summary
ConstructorsConstructorDescriptionSyncAttachmentsPayload
(SyncAttachmentsPayload.Target target, List<AttachmentType<?>> types, byte[] syncPayload) Creates an instance of aSyncAttachmentsPayload
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.byte[]
Returns the value of thesyncPayload
record component.target()
Returns the value of thetarget
record component.final String
toString()
Returns a string representation of this record class.CustomPacketPayload.Type
<? extends CustomPacketPayload> type()
List
<AttachmentType<?>> types()
Returns the value of thetypes
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
target
The field for thetarget
record component. -
types
The field for thetypes
record component. -
syncPayload
private final byte[] syncPayloadThe field for thesyncPayload
record component. -
TYPE
-
STREAM_CODEC
-
-
Constructor Details
-
SyncAttachmentsPayload
public SyncAttachmentsPayload(SyncAttachmentsPayload.Target target, List<AttachmentType<?>> types, byte[] syncPayload) Creates an instance of aSyncAttachmentsPayload
record class.- Parameters:
target
- the value for thetarget
record componenttypes
- the value for thetypes
record componentsyncPayload
- the value for thesyncPayload
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)
. -
target
Returns the value of thetarget
record component.- Returns:
- the value of the
target
record component
-
types
Returns the value of thetypes
record component.- Returns:
- the value of the
types
record component
-
syncPayload
public byte[] syncPayload()Returns the value of thesyncPayload
record component.- Returns:
- the value of the
syncPayload
record component
-