Record Class ServerboundCustomQueryAnswerPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ServerboundCustomQueryAnswerPacket
- All Implemented Interfaces:
Packet<ServerLoginPacketListener>
,ICustomPacket<ServerboundCustomQueryAnswerPacket>
public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable CustomQueryAnswerPayload payload)
extends Record
implements Packet<ServerLoginPacketListener>, ICustomPacket<ServerboundCustomQueryAnswerPacket>
-
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.int
getIndex()
Returns a unsafe reference to this packet's internal data.getName()
void
handle
(ServerLoginPacketListener p_298492_) final int
hashCode()
Returns a hash code value for this object.payload()
Returns the value of thepayload
record component.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.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.minecraftforge.network.ICustomPacket
getDirection, getThis
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>
-
getInternalData
Description copied from interface:ICustomPacket
Returns a unsafe reference to this packet's internal data. Any modifications to this buffer will be reflected in the main buffer.- Specified by:
getInternalData
in interfaceICustomPacket<ServerboundCustomQueryAnswerPacket>
-
getName
- Specified by:
getName
in interfaceICustomPacket<ServerboundCustomQueryAnswerPacket>
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceICustomPacket<ServerboundCustomQueryAnswerPacket>
-
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
-