Package net.minecraft.client.network
Record Class ChatPreviewer.Response
java.lang.Object
java.lang.Record
net.minecraft.client.network.ChatPreviewer.Response
- Record Components:
receptionTimestamp-query- the message that was queried to previewpreviewText-
- Enclosing class:
ChatPreviewer
@Environment(CLIENT)
public static record ChatPreviewer.Response(long receptionTimestamp, String query, @Nullable Text previewText)
extends Record
A response to the preview query.
- Mappings:
Namespace Name official ehg$aintermediary net/minecraft/class_7479$class_7481named net/minecraft/client/network/ChatPreviewer$Responseofficial aintermediary comp_826named receptionTimestampofficial bintermediary comp_827named queryofficial cintermediary comp_828named previewText
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thepreviewTextrecord component.private final StringThe field for thequeryrecord component.private final longThe field for thereceptionTimestamprecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleancanConsume(String message) Returns whether the response can be consumed for themessage.final booleanIndicates whether some other object is "equal to" this one.(package private) booleanReturns the cooldown for consuming the preview has passed.final inthashCode()Returns a hash code value for this object.Returns the value of thepreviewTextrecord component.query()Returns the value of thequeryrecord component.private booleanqueryEquals(String query) Returns whether normalizedqueryequals the response query.longReturns the value of thereceptionTimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
receptionTimestamp
private final long receptionTimestampThe field for thereceptionTimestamprecord component. -
query
The field for thequeryrecord component. -
previewText
The field for thepreviewTextrecord component.
-
-
Constructor Details
-
Response
-
-
Method Details
-
queryEquals
Returns whether normalizedqueryequals the response query.- Returns:
- whether normalized
queryequals the response query - Mappings:
Namespace Name Mixin selector official aLehg$a;a(Ljava/lang/String;)Zintermediary method_44929Lnet/minecraft/class_7479$class_7481;method_44929(Ljava/lang/String;)Znamed queryEqualsLnet/minecraft/client/network/ChatPreviewer$Response;queryEquals(Ljava/lang/String;)Z
-
canConsume
Returns whether the response can be consumed for themessage.This returns
trueif themessageequals the queried message and the cooldown has passed.- Returns:
- whether the response can be consumed for the
message - Mappings:
Namespace Name Mixin selector official bLehg$a;b(Ljava/lang/String;)Zintermediary method_44045Lnet/minecraft/class_7479$class_7481;method_44045(Ljava/lang/String;)Znamed canConsumeLnet/minecraft/client/network/ChatPreviewer$Response;canConsume(Ljava/lang/String;)Z
-
hasCooldownPassed
boolean hasCooldownPassed()Returns the cooldown for consuming the preview has passed.- Returns:
- the cooldown for consuming the preview has passed
- See Also:
- Mappings:
Namespace Name Mixin selector official dLehg$a;d()Zintermediary method_44930Lnet/minecraft/class_7479$class_7481;method_44930()Znamed hasCooldownPassedLnet/minecraft/client/network/ChatPreviewer$Response;hasCooldownPassed()Z
-
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 '=='. -
receptionTimestamp
public long receptionTimestamp()Returns the value of thereceptionTimestamprecord component.- Returns:
- the value of the
receptionTimestamprecord component
-
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-
previewText
Returns the value of thepreviewTextrecord component.- Returns:
- the value of the
previewTextrecord component
-