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
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final CustomQueryAnswerPayloadThe field for thepayloadrecord component.static final StreamCodec<FriendlyByteBuf, ServerboundCustomQueryAnswerPacket> private final intThe field for thetransactionIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundCustomQueryAnswerPacket(int transactionId, CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerLoginPacketListener p_298492_) final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.private static ServerboundCustomQueryAnswerPacketread(FriendlyByteBuf p_300962_) private static CustomQueryAnswerPayloadreadPayload(int p_298211_, FriendlyByteBuf p_300600_) private static CustomQueryAnswerPayloadreadUnknownPayload(FriendlyByteBuf p_299934_) final StringtoString()Returns a string representation of this record class.intReturns the value of thetransactionIdrecord component.type()private voidwrite(FriendlyByteBuf p_299339_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.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
-
ServerboundCustomQueryAnswerPacket
public ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacketrecord class.- Parameters:
transactionId- the value for thetransactionIdrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
read
-
readPayload
-
readUnknownPayload
-
write
-
type
- Specified by:
typein interfacePacket<ServerLoginPacketListener>
-
handle
- Specified by:
handlein 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 thetransactionIdrecord component.- Returns:
- the value of the
transactionIdrecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-