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 SummaryFieldsModifier and TypeFieldDescriptionprivate static final intprivate final CustomQueryAnswerPayloadThe field for thepayloadrecord component.private final intThe field for thetransactionIdrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionServerboundCustomQueryAnswerPacket(int transactionId, CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacketrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetIndex()Returns a unsafe reference to this packet's internal data.getName()voidhandle(ServerLoginPacketListener p_298492_) final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.read(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.voidwrite(FriendlyByteBuf p_299339_) Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.network.ICustomPacketgetDirection, getThisMethods inherited from interface net.minecraft.network.protocol.PacketisSkippable, nextProtocol
- 
Field Details- 
transactionIdprivate final int transactionIdThe field for thetransactionIdrecord component.
- 
payloadThe field for thepayloadrecord component.
- 
MAX_PAYLOAD_SIZEprivate static final int MAX_PAYLOAD_SIZE- See Also:
 
 
- 
- 
Constructor Details- 
ServerboundCustomQueryAnswerPacketpublic ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable CustomQueryAnswerPayload payload) Creates an instance of aServerboundCustomQueryAnswerPacketrecord class.- Parameters:
- transactionId- the value for the- transactionIdrecord component
- payload- the value for the- payloadrecord component
 
 
- 
- 
Method Details- 
read
- 
readPayload
- 
readUnknownPayload
- 
write- Specified by:
- writein interface- Packet<ServerLoginPacketListener>
 
- 
handle- Specified by:
- handlein interface- Packet<ServerLoginPacketListener>
 
- 
getInternalDataDescription copied from interface:ICustomPacketReturns a unsafe reference to this packet's internal data. Any modifications to this buffer will be reflected in the main buffer.- Specified by:
- getInternalDatain interface- ICustomPacket<ServerboundCustomQueryAnswerPacket>
 
- 
getName- Specified by:
- getNamein interface- ICustomPacket<ServerboundCustomQueryAnswerPacket>
 
- 
getIndexpublic int getIndex()- Specified by:
- getIndexin interface- ICustomPacket<ServerboundCustomQueryAnswerPacket>
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
transactionIdpublic int transactionId()Returns the value of thetransactionIdrecord component.- Returns:
- the value of the transactionIdrecord component
 
- 
payloadReturns the value of thepayloadrecord component.- Returns:
- the value of the payloadrecord component
 
 
-