Record Class AttachmentSyncPayload

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.internal.attachment.AttachmentSyncPayload
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public record AttachmentSyncPayload(AttachmentSyncPayload.Target target, int entityId, @Nullable net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries) extends Record implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
  • Field Details

    • TYPE

      public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<AttachmentSyncPayload> TYPE
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, AttachmentSyncPayload> STREAM_CODEC
  • Constructor Details

    • AttachmentSyncPayload

      public AttachmentSyncPayload(AttachmentSyncPayload.Target target, int entityId, @Nullable @Nullable net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries)
      Creates an instance of a AttachmentSyncPayload record class.
      Parameters:
      target - the value for the target record component
      entityId - the value for the entityId record component
      pos - the value for the pos record component
      entries - the value for the entries record component
  • Method Details

    • entity

      public static AttachmentSyncPayload entity(int entityId, List<AttachmentSyncPayload.Entry> entries)
    • block

      public static AttachmentSyncPayload block(net.minecraft.core.BlockPos pos, List<AttachmentSyncPayload.Entry> entries)
    • level

      public static AttachmentSyncPayload level(List<AttachmentSyncPayload.Entry> entries)
      The level the player is in.
    • server

      public static AttachmentSyncPayload server(List<AttachmentSyncPayload.Entry> entries)
    • type

      public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<AttachmentSyncPayload> type()
      Specified by:
      type in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • target

      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • entityId

      public int entityId()
      Returns the value of the entityId record component.
      Returns:
      the value of the entityId record component
    • pos

      @Nullable public @Nullable net.minecraft.core.BlockPos pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • entries

      public List<AttachmentSyncPayload.Entry> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component