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.static final StreamCodec
<FriendlyByteBuf, ServerboundCustomQueryAnswerPacket> 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_298492_) final int
hashCode()
Returns a hash code value for this object.payload()
Returns the value of thepayload
record component.private static ServerboundCustomQueryAnswerPacket
read
(FriendlyByteBuf p_300962_) private static CustomQueryAnswerPayload
readPayload
(int p_298211_, FriendlyByteBuf p_300600_) private static CustomQueryAnswerPayload
readUnknownPayload
(FriendlyByteBuf p_299934_) final String
toString()
Returns a string representation of this record class.int
Returns the value of thetransactionId
record component.type()
private void
write
(FriendlyByteBuf p_299339_) 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, isTerminal
-
Field Details
-
transactionId
private final int transactionIdThe field for thetransactionId
record component. -
payload
The field for thepayload
record component. -
STREAM_CODEC
-
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
-
type
- Specified by:
type
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
-