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 recordstatic final recordstatic final recordstatic final recordstatic interfaceNested 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 thesyncPayloadrecord component.private final SyncAttachmentsPayload.TargetThe field for thetargetrecord component.static final CustomPacketPayload.Type<SyncAttachmentsPayload> private final List<AttachmentType<?>> The field for thetypesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSyncAttachmentsPayload(SyncAttachmentsPayload.Target target, List<AttachmentType<?>> types, byte[] syncPayload) Creates an instance of aSyncAttachmentsPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.byte[]Returns the value of thesyncPayloadrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.CustomPacketPayload.Type<? extends CustomPacketPayload> type()List<AttachmentType<?>> types()Returns the value of thetypesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
target
The field for thetargetrecord component. -
types
The field for thetypesrecord component. -
syncPayload
private final byte[] syncPayloadThe field for thesyncPayloadrecord component. -
TYPE
-
STREAM_CODEC
-
-
Constructor Details
-
SyncAttachmentsPayload
public SyncAttachmentsPayload(SyncAttachmentsPayload.Target target, List<AttachmentType<?>> types, byte[] syncPayload) Creates an instance of aSyncAttachmentsPayloadrecord class.- Parameters:
target- the value for thetargetrecord componenttypes- the value for thetypesrecord componentsyncPayload- the value for thesyncPayloadrecord component
-
-
Method Details
-
type
- Specified by:
typein 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 thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-
syncPayload
public byte[] syncPayload()Returns the value of thesyncPayloadrecord component.- Returns:
- the value of the
syncPayloadrecord component
-