Record Class AttachmentSyncPayload
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.internal.attachment.AttachmentSyncPayload
- All Implemented Interfaces:
CustomPacketPayload
public record AttachmentSyncPayload(int entityId, @Nullable net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries)
extends Record
implements CustomPacketPayload
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordvalueisnullwhen the value was reset to its default.Nested classes/interfaces inherited from interface net.ixdarklord.coolcatcore.api.network.CustomPacketPayload
CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends io.netty.buffer.ByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec<net.minecraft.network.FriendlyByteBuf,AttachmentSyncPayload> static final CustomPacketPayload.Type<AttachmentSyncPayload> -
Constructor Summary
ConstructorsConstructorDescriptionAttachmentSyncPayload(int entityId, @Nullable net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries) Creates an instance of aAttachmentSyncPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AttachmentSyncPayloadblock(net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries) static AttachmentSyncPayloadentity(int entityId, List<AttachmentSyncPayload.Entry> entries) intentityId()Returns the value of theentityIdrecord component.entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.core.BlockPospos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.type()
-
Field Details
-
TYPE
-
STREAM_CODEC
public static final StreamCodec<net.minecraft.network.FriendlyByteBuf,AttachmentSyncPayload> STREAM_CODEC
-
-
Constructor Details
-
AttachmentSyncPayload
public AttachmentSyncPayload(int entityId, @Nullable @Nullable net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries) Creates an instance of aAttachmentSyncPayloadrecord class.- Parameters:
entityId- the value for theentityIdrecord componentpos- the value for theposrecord componententries- the value for theentriesrecord component
-
-
Method Details
-
entity
-
block
public static AttachmentSyncPayload block(net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
pos
@Nullable public @Nullable net.minecraft.core.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-