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 @Nullable CustomQueryAnswerPayloadThe field for thepayloadrecord component.static final StreamCodec<FriendlyByteBuf, ServerboundCustomQueryAnswerPacket> private final intThe field for thetransactionIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundCustomQueryAnswerPacket(int transactionId, @Nullable 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 listener) Passes this Packet on to the PacketListener for processing.final inthashCode()Returns a hash code value for this object.@Nullable CustomQueryAnswerPayloadpayload()Returns the value of thepayloadrecord component.private static ServerboundCustomQueryAnswerPacketread(FriendlyByteBuf input) private static CustomQueryAnswerPayloadreadPayload(int transactionId, FriendlyByteBuf input) private static CustomQueryAnswerPayloadfinal StringtoString()Returns a string representation of this record class.intReturns the value of thetransactionIdrecord component.type()private voidwrite(FriendlyByteBuf output) 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
-
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
Description copied from interface:PacketPasses this Packet on to the PacketListener for processing.- Specified by:
handlein interfacePacket<ServerLoginPacketListener>
-
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
-