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 preview
previewText -
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$a
intermediary net/minecraft/class_7479$class_7481
named net/minecraft/client/network/ChatPreviewer$Response
official a
intermediary comp_826
named receptionTimestamp
official b
intermediary comp_827
named query
official c
intermediary comp_828
named previewText
  • Field Details

  • Constructor Details

  • Method Details

    • queryEquals

      private boolean queryEquals(String query)
      Returns whether normalized query equals the response query.
      Returns:
      whether normalized query equals the response query
      Mappings:
      Namespace Name Mixin selector
      official a Lehg$a;a(Ljava/lang/String;)Z
      intermediary method_44929 Lnet/minecraft/class_7479$class_7481;method_44929(Ljava/lang/String;)Z
      named queryEquals Lnet/minecraft/client/network/ChatPreviewer$Response;queryEquals(Ljava/lang/String;)Z
    • canConsume

      boolean canConsume(String message)
      Returns whether the response can be consumed for the message.

      This returns true if the message equals the queried message and the cooldown has passed.

      Returns:
      whether the response can be consumed for the message
      Mappings:
      Namespace Name Mixin selector
      official b Lehg$a;b(Ljava/lang/String;)Z
      intermediary method_44045 Lnet/minecraft/class_7479$class_7481;method_44045(Ljava/lang/String;)Z
      named canConsume Lnet/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 d Lehg$a;d()Z
      intermediary method_44930 Lnet/minecraft/class_7479$class_7481;method_44930()Z
      named hasCooldownPassed Lnet/minecraft/client/network/ChatPreviewer$Response;hasCooldownPassed()Z
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • receptionTimestamp

      public long receptionTimestamp()
      Returns the value of the receptionTimestamp record component.
      Returns:
      the value of the receptionTimestamp record component
    • query

      public String query()
      Returns the value of the query record component.
      Returns:
      the value of the query record component
    • previewText

      @Nullable public @Nullable Text previewText()
      Returns the value of the previewText record component.
      Returns:
      the value of the previewText record component