Record Class ServerboundCustomQueryAnswerPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ServerboundCustomQueryAnswerPacket
- All Implemented Interfaces:
Packet<ServerLoginPacketListener>
public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable CustomQueryAnswerPayload payload)
extends Record
implements Packet<ServerLoginPacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final CustomQueryAnswerPayload
The field for thepayload
record component.private final int
The field for thetransactionId
record component. -
Constructor Summary
ConstructorDescriptionServerboundCustomQueryAnswerPacket
(int transactionId, CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerLoginPacketListener p_294750_) final int
hashCode()
Returns a hash code value for this object.payload()
Returns the value of thepayload
record component.read
(FriendlyByteBuf p_295711_) private static SimpleQueryPayload
readPayload
(int p_296215_, FriendlyByteBuf p_295168_) private static SimpleQueryPayload
readUnknownPayload
(FriendlyByteBuf p_294928_) final String
toString()
Returns a string representation of this record class.int
Returns the value of thetransactionId
record component.void
write
(FriendlyByteBuf p_296127_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, nextProtocol
-
Field Details
-
transactionId
private final int transactionIdThe field for thetransactionId
record component. -
payload
The field for thepayload
record component. -
MAX_PAYLOAD_SIZE
private static final int MAX_PAYLOAD_SIZE- See Also:
-
-
Constructor Details
-
ServerboundCustomQueryAnswerPacket
public ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacket
record class.- Parameters:
transactionId
- the value for thetransactionId
record componentpayload
- the value for thepayload
record component
-
-
Method Details
-
read
-
readPayload
-
readUnknownPayload
-
write
- Specified by:
write
in interfacePacket<ServerLoginPacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ServerLoginPacketListener>
-
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 '=='. -
transactionId
public int transactionId()Returns the value of thetransactionId
record component.- Returns:
- the value of the
transactionId
record component
-
payload
Returns the value of thepayload
record component.- Returns:
- the value of the
payload
record component
-