Record Class ClientboundCustomQueryPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ClientboundCustomQueryPacket
- All Implemented Interfaces:
Packet<ClientLoginPacketListener>
public record ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload payload)
extends Record
implements Packet<ClientLoginPacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final CustomQueryPayload
The field for thepayload
record component.static final StreamCodec
<FriendlyByteBuf, ClientboundCustomQueryPacket> private final int
The field for thetransactionId
record component. -
Constructor Summary
ModifierConstructorDescriptionClientboundCustomQueryPacket
(int transactionId, CustomQueryPayload payload) Creates an instance of aClientboundCustomQueryPacket
record class.private
ClientboundCustomQueryPacket
(FriendlyByteBuf p_179810_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientLoginPacketListener p_134754_) final int
hashCode()
Returns a hash code value for this object.payload()
Returns the value of thepayload
record component.private static CustomQueryPayload
readPayload
(ResourceLocation p_300079_, FriendlyByteBuf p_299332_) private static DiscardedQueryPayload
readUnknownPayload
(ResourceLocation p_299981_, FriendlyByteBuf p_297706_) final String
toString()
Returns a string representation of this record class.int
Returns the value of thetransactionId
record component.type()
private void
write
(FriendlyByteBuf p_134757_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
transactionId
private final int transactionIdThe field for thetransactionId
record component. -
payload
The field for thepayload
record component. -
STREAM_CODEC
-
MAX_PAYLOAD_SIZE
private static final int MAX_PAYLOAD_SIZE- See Also:
-
-
Constructor Details
-
ClientboundCustomQueryPacket
-
ClientboundCustomQueryPacket
Creates an instance of aClientboundCustomQueryPacket
record class.- Parameters:
transactionId
- the value for thetransactionId
record componentpayload
- the value for thepayload
record 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
-
type
- Specified by:
type
in interfacePacket<ClientLoginPacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientLoginPacketListener>
-
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
-