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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientboundChatPreviewPacket(int queryId, @Nullable Component preview) Creates an instance of aClientboundChatPreviewPacketrecord class.ClientboundChatPreviewPacket(FriendlyByteBuf p_237600_) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_237606_) final inthashCode()Returns a hash code value for this object.boolean@Nullable Componentpreview()Returns the value of thepreviewrecord component.intqueryId()Returns the value of thequeryIdrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_237602_)
-
Field Details
-
queryId
private final int queryIdThe field for thequeryIdrecord component. -
preview
The field for thepreviewrecord component.
-
-
Constructor Details
-
ClientboundChatPreviewPacket
-
ClientboundChatPreviewPacket
Creates an instance of aClientboundChatPreviewPacketrecord class.- Parameters:
queryId- the value for thequeryIdrecord componentpreview- the value for thepreviewrecord component
-
-
Method Details
-
write
- Specified by:
writein interfacePacket<ClientGamePacketListener>
-
isSkippable
public boolean isSkippable()- Specified by:
isSkippablein interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handlein 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 thequeryIdrecord component.- Returns:
- the value of the
queryIdrecord component
-
preview
Returns the value of thepreviewrecord component.- Returns:
- the value of the
previewrecord component
-