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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final CustomQueryPayloadThe field for thepayloadrecord component.private final intThe field for thetransactionIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload) Creates an instance of aClientboundCustomQueryPacketrecord class.ClientboundCustomQueryPacket(FriendlyByteBuf p_179810_) -
Method Summary
Modifier 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.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.network.ICustomPacket
getDirection, getThisMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, nextProtocol
-
Field Details
-
transactionId
private final int transactionIdThe field for thetransactionIdrecord component. -
payload
The field for thepayloadrecord component. -
MAX_PAYLOAD_SIZE
private static final int MAX_PAYLOAD_SIZE- See Also:
-
-
Constructor Details
-
ClientboundCustomQueryPacket
-
ClientboundCustomQueryPacket
Creates an instance of aClientboundCustomQueryPacketrecord class.- Parameters:
transactionId- the value for thetransactionIdrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
readPayload
private static CustomQueryPayload readPayload(ResourceLocation p_300079_, FriendlyByteBuf p_299332_) -
readUnknownPayload
private static DiscardedQueryPayload readUnknownPayload(ResourceLocation p_299981_, FriendlyByteBuf p_297706_) -
write
- Specified by:
writein interfacePacket<ClientLoginPacketListener>
-
handle
- Specified by:
handlein interfacePacket<ClientLoginPacketListener>
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceICustomPacket<ClientboundCustomQueryPacket>
-
getName
- Specified by:
getNamein interfaceICustomPacket<ClientboundCustomQueryPacket>
-
getInternalData
Description 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 interfaceICustomPacket<ClientboundCustomQueryPacket>
-
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
-