Record Class ClientboundCustomQueryPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ClientboundCustomQueryPacket
- All Implemented Interfaces:
- Packet<ClientLoginPacketListener>,- ICustomPacket<ClientboundCustomQueryPacket>
public record ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload)
extends Record
implements Packet<ClientLoginPacketListener>, ICustomPacket<ClientboundCustomQueryPacket>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final intprivate final CustomQueryPayloadThe field for thepayloadrecord component.private final intThe field for thetransactionIdrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload) Creates an instance of aClientboundCustomQueryPacketrecord class.ClientboundCustomQueryPacket(FriendlyByteBuf p_179810_) 
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetIndex()@Nullable FriendlyByteBufReturns a unsafe reference to this packet's internal data.getName()voidhandle(ClientLoginPacketListener p_134754_) final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.private static CustomQueryPayloadreadPayload(ResourceLocation p_300079_, FriendlyByteBuf p_299332_) private static DiscardedQueryPayloadreadUnknownPayload(ResourceLocation p_299981_, FriendlyByteBuf p_297706_) final StringtoString()Returns a string representation of this record class.intReturns the value of thetransactionIdrecord component.voidwrite(FriendlyByteBuf p_134757_) 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- 
ClientboundCustomQueryPacket
- 
ClientboundCustomQueryPacketCreates an instance of aClientboundCustomQueryPacketrecord class.- Parameters:
- transactionId- the value for the- transactionIdrecord component
- payload- the value for the- payloadrecord component
 
 
- 
- 
Method Details- 
readPayloadprivate static CustomQueryPayload readPayload(ResourceLocation p_300079_, FriendlyByteBuf p_299332_) 
- 
readUnknownPayloadprivate static DiscardedQueryPayload readUnknownPayload(ResourceLocation p_299981_, FriendlyByteBuf p_297706_) 
- 
write- Specified by:
- writein interface- Packet<ClientLoginPacketListener>
 
- 
handle- Specified by:
- handlein interface- Packet<ClientLoginPacketListener>
 
- 
getIndexpublic int getIndex()- Specified by:
- getIndexin interface- ICustomPacket<ClientboundCustomQueryPacket>
 
- 
getName- Specified by:
- getNamein interface- ICustomPacket<ClientboundCustomQueryPacket>
 
- 
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<ClientboundCustomQueryPacket>
 
- 
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
 
 
-