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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final CustomQueryPayloadThe field for thepayloadrecord component.static final StreamCodec<FriendlyByteBuf, ClientboundCustomQueryPacket> private final intThe field for thetransactionIdrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload) Creates an instance of aClientboundCustomQueryPacketrecord class.private -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientLoginPacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.private static CustomQueryPayloadreadPayload(Identifier identifier, FriendlyByteBuf input) private static DiscardedQueryPayloadreadUnknownPayload(Identifier identifier, FriendlyByteBuf input) final StringtoString()Returns a string representation of this record class.intReturns the value of thetransactionIdrecord component.type()private voidwrite(FriendlyByteBuf output) Writes the raw packet data to the data stream.Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
transactionId
private final int transactionIdThe field for thetransactionIdrecord component. -
payload
The field for thepayloadrecord component. -
STREAM_CODEC
-
MAX_PAYLOAD_SIZE
private static final int MAX_PAYLOAD_SIZE- See Also:
-
-
Constructor Details
-
ClientboundCustomQueryPacket
-
ClientboundCustomQueryPacket
Creates an instance of aClientboundCustomQueryPacketrecord class.- Parameters:
transactionId- the value for thetransactionIdrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
readPayload
-
readUnknownPayload
private static DiscardedQueryPayload readUnknownPayload(Identifier identifier, FriendlyByteBuf input) -
write
Writes the raw packet data to the data stream. -
type
- Specified by:
typein interfacePacket<ClientLoginPacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientLoginPacketListener>
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
transactionId
public int transactionId()Returns the value of thetransactionIdrecord component.- Returns:
- the value of the
transactionIdrecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-