Record Class ClientboundCustomQueryPacket

java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ClientboundCustomQueryPacket
All Implemented Interfaces:
Packet<ClientLoginPacketListener>

public record ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload) extends Record implements Packet<ClientLoginPacketListener>
  • Field Details

    • transactionId

      private final int transactionId
      The field for the transactionId record component.
    • payload

      private final CustomQueryPayload payload
      The field for the payload record component.
    • MAX_PAYLOAD_SIZE

      private static final int MAX_PAYLOAD_SIZE
      See Also:
  • Constructor Details

    • ClientboundCustomQueryPacket

      public ClientboundCustomQueryPacket(FriendlyByteBuf p_179810_)
    • ClientboundCustomQueryPacket

      public ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload)
      Creates an instance of a ClientboundCustomQueryPacket record class.
      Parameters:
      transactionId - the value for the transactionId record component
      payload - the value for the payload record component
  • Method Details

    • readPayload

      private static CustomQueryPayload readPayload(ResourceLocation p_295267_, FriendlyByteBuf p_295117_)
    • readUnknownPayload

      private static SimpleQueryPayload readUnknownPayload(ResourceLocation p_294837_, FriendlyByteBuf p_296380_)
    • write

      public void write(FriendlyByteBuf p_134757_)
      Specified by:
      write in interface Packet<ClientLoginPacketListener>
    • handle

      public void handle(ClientLoginPacketListener p_134754_)
      Specified by:
      handle in interface Packet<ClientLoginPacketListener>
    • 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 '=='.
      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.
    • transactionId

      public int transactionId()
      Returns the value of the transactionId record component.
      Returns:
      the value of the transactionId record component
    • payload

      public CustomQueryPayload payload()
      Returns the value of the payload record component.
      Returns:
      the value of the payload record component