Record Class ClientboundChatPreviewPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundChatPreviewPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundChatPreviewPacket(int queryId, @Nullable Component preview)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionClientboundChatPreviewPacket
(int queryId, @Nullable Component preview) Creates an instance of aClientboundChatPreviewPacket
record class.ClientboundChatPreviewPacket
(FriendlyByteBuf p_237600_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_237606_) final int
hashCode()
Returns a hash code value for this object.boolean
@Nullable Component
preview()
Returns the value of thepreview
record component.int
queryId()
Returns the value of thequeryId
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_237602_)
-
Field Details
-
queryId
private final int queryIdThe field for thequeryId
record component. -
preview
The field for thepreview
record component.
-
-
Constructor Details
-
ClientboundChatPreviewPacket
-
ClientboundChatPreviewPacket
Creates an instance of aClientboundChatPreviewPacket
record class.- Parameters:
queryId
- the value for thequeryId
record componentpreview
- the value for thepreview
record component
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ClientGamePacketListener>
-
isSkippable
public boolean isSkippable()- Specified by:
isSkippable
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
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 '=='. -
queryId
public int queryId()Returns the value of thequeryId
record component.- Returns:
- the value of the
queryId
record component
-
preview
Returns the value of thepreview
record component.- Returns:
- the value of the
preview
record component
-