Interface ChatLog

All Known Implementing Classes:
ChatLogImpl

@Environment(CLIENT) public interface ChatLog
A chat log holds received message entries with sequential indices, where newer entries receive bigger indices. An implementation using fixed-size array is available at ChatLogImpl.

There are two types of entries. HeaderEntry is an entry containing only the message's header, and is used for censored messages. ReceivedMessage is an entry for full chat or game messages.

Mappings:
Namespace Name
official evf
intermediary net/minecraft/class_7555
named net/minecraft/client/report/log/ChatLog
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A pair of the entry's index and the entry itself.
    static class 
    A set of streams of log entries.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds entry to the log.
    default boolean
    contains(int index)
    Returns whether the log contains an entry with index index.
    Returns the empty stream.
    get(int index)
    Returns the entry with index index, or null if there is no such entry in the log.
    getIndexed(int index)
    Returns the indexed entry with index index, or null if there is no such entry in the log.
    int
    Returns the maximum index currently used within the log.
    int
    Returns the minimum index currently used within the log.
    default int
    getNextIndex(int index)
    Returns the index offset by 1 if there is an entry with that index, or -1 if there is no entry with the offset index.
    int
    getOffsetIndex(int index, int offset)
    Returns the index offset by offset if there is an entry with that index, or -1 if there is no entry with the offset index.
    default int
    getPreviousIndex(int index)
    Returns the index offset by -1 if there is an entry with that index, or -1 if there is no entry with the offset index.
    stream(int startIndex, IntUnaryOperator nextIndexGetter)
    Returns the streams starting from startIndex.
    Returns the streams starting from the biggest index in the log with entires ordered antichronologically (in descending order).
    streamBackward(int startIndex)
    Returns the streams starting from startIndex with entires ordered antichronologically (in descending order).
    Returns the streams starting from the smallest index in the log with entires ordered chronologically (in ascending order).
    streamForward(int startIndex)
    Returns the streams starting from startIndex with entires ordered chronologically (in ascending order).
    streamForward(int startIndex, int endIndex)
    Returns the streams starting from startIndex with entires ordered chronologically (in ascending order) up to and including endIndex.
  • Field Details

    • MISSING_NEXT_INDEX

      static final int MISSING_NEXT_INDEX
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a:I
      intermediary field_39629 Lnet/minecraft/class_7555;field_39629:I
      named MISSING_NEXT_INDEX Lnet/minecraft/client/report/log/ChatLog;MISSING_NEXT_INDEX:I
  • Method Details

    • add

      void add(ChatLogEntry entry)
      Adds entry to the log.
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a(Levi;)V
      intermediary method_44535 Lnet/minecraft/class_7555;method_44535(Lnet/minecraft/class_7629;)V
      named add Lnet/minecraft/client/report/log/ChatLog;add(Lnet/minecraft/client/report/log/ChatLogEntry;)V
    • get

      Returns the entry with index index, or null if there is no such entry in the log.
      Returns:
      the entry with index index, or null if there is no such entry in the log
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a(I)Levi;
      intermediary method_44532 Lnet/minecraft/class_7555;method_44532(I)Lnet/minecraft/class_7629;
      named get Lnet/minecraft/client/report/log/ChatLog;get(I)Lnet/minecraft/client/report/log/ChatLogEntry;
    • getIndexed

      @Nullable default @Nullable ChatLog.IndexedEntry<ChatLogEntry> getIndexed(int index)
      Returns the indexed entry with index index, or null if there is no such entry in the log.
      Returns:
      the indexed entry with index index, or null if there is no such entry in the log
      Mappings:
      Namespace Name Mixin selector
      official b Levf;b(I)Levf$a;
      intermediary method_44537 Lnet/minecraft/class_7555;method_44537(I)Lnet/minecraft/class_7555$class_7560;
      named getIndexed Lnet/minecraft/client/report/log/ChatLog;getIndexed(I)Lnet/minecraft/client/report/log/ChatLog$IndexedEntry;
    • contains

      default boolean contains(int index)
      Returns whether the log contains an entry with index index.
      Returns:
      whether the log contains an entry with index index
      Mappings:
      Namespace Name Mixin selector
      official c Levf;c(I)Z
      intermediary method_44540 Lnet/minecraft/class_7555;method_44540(I)Z
      named contains Lnet/minecraft/client/report/log/ChatLog;contains(I)Z
    • getOffsetIndex

      int getOffsetIndex(int index, int offset)
      Returns the index offset by offset if there is an entry with that index, or -1 if there is no entry with the offset index.
      Returns:
      the index offset by offset if there is an entry with that index, or -1 if there is no entry with the offset index
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a(II)I
      intermediary method_44533 Lnet/minecraft/class_7555;method_44533(II)I
      named getOffsetIndex Lnet/minecraft/client/report/log/ChatLog;getOffsetIndex(II)I
    • getPreviousIndex

      default int getPreviousIndex(int index)
      Returns the index offset by -1 if there is an entry with that index, or -1 if there is no entry with the offset index.
      Returns:
      the index offset by -1 if there is an entry with that index, or -1 if there is no entry with the offset index
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official d Levf;d(I)I
      intermediary method_44543 Lnet/minecraft/class_7555;method_44543(I)I
      named getPreviousIndex Lnet/minecraft/client/report/log/ChatLog;getPreviousIndex(I)I
    • getNextIndex

      default int getNextIndex(int index)
      Returns the index offset by 1 if there is an entry with that index, or -1 if there is no entry with the offset index.
      Returns:
      the index offset by 1 if there is an entry with that index, or -1 if there is no entry with the offset index
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official e Levf;e(I)I
      intermediary method_44545 Lnet/minecraft/class_7555;method_44545(I)I
      named getNextIndex Lnet/minecraft/client/report/log/ChatLog;getNextIndex(I)I
    • getMaxIndex

      int getMaxIndex()
      Returns the maximum index currently used within the log.

      This value changes every time a new entry gets added. The entry associated with this index is the newest one in the log.

      Returns:
      the maximum index currently used within the log
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a()I
      intermediary method_44531 Lnet/minecraft/class_7555;method_44531()I
      named getMaxIndex Lnet/minecraft/client/report/log/ChatLog;getMaxIndex()I
    • getMinIndex

      int getMinIndex()
      Returns the minimum index currently used within the log.

      This value can change every time a new entry gets added. The entry associated with this index is the oldest one in the log.

      Returns:
      the minimum index currently used within the log
      Mappings:
      Namespace Name Mixin selector
      official b Levf;b()I
      intermediary method_44536 Lnet/minecraft/class_7555;method_44536()I
      named getMinIndex Lnet/minecraft/client/report/log/ChatLog;getMinIndex()I
    • streamForward

      default ChatLog.Streams streamForward()
      Returns the streams starting from the smallest index in the log with entires ordered chronologically (in ascending order).
      Returns:
      the streams starting from the smallest index in the log with entires ordered chronologically (in ascending order)
      Mappings:
      Namespace Name Mixin selector
      official c Levf;c()Levf$b;
      intermediary method_44539 Lnet/minecraft/class_7555;method_44539()Lnet/minecraft/class_7555$class_7556;
      named streamForward Lnet/minecraft/client/report/log/ChatLog;streamForward()Lnet/minecraft/client/report/log/ChatLog$Streams;
    • streamBackward

      default ChatLog.Streams streamBackward()
      Returns the streams starting from the biggest index in the log with entires ordered antichronologically (in descending order).
      Returns:
      the streams starting from the biggest index in the log with entires ordered antichronologically (in descending order)
      Mappings:
      Namespace Name Mixin selector
      official d Levf;d()Levf$b;
      intermediary method_44702 Lnet/minecraft/class_7555;method_44702()Lnet/minecraft/class_7555$class_7556;
      named streamBackward Lnet/minecraft/client/report/log/ChatLog;streamBackward()Lnet/minecraft/client/report/log/ChatLog$Streams;
    • streamForward

      default ChatLog.Streams streamForward(int startIndex)
      Returns the streams starting from startIndex with entires ordered chronologically (in ascending order).
      Returns:
      the streams starting from startIndex with entires ordered chronologically (in ascending order)
      Implementation Note:
      If startIndex is not in the log, this returns emptyStreams().
      Mappings:
      Namespace Name Mixin selector
      official f Levf;f(I)Levf$b;
      intermediary method_44546 Lnet/minecraft/class_7555;method_44546(I)Lnet/minecraft/class_7555$class_7556;
      named streamForward Lnet/minecraft/client/report/log/ChatLog;streamForward(I)Lnet/minecraft/client/report/log/ChatLog$Streams;
    • streamBackward

      default ChatLog.Streams streamBackward(int startIndex)
      Returns the streams starting from startIndex with entires ordered antichronologically (in descending order).
      Returns:
      the streams starting from startIndex with entires ordered antichronologically (in descending order)
      Implementation Note:
      If startIndex is not in the log, this returns emptyStreams().
      Mappings:
      Namespace Name Mixin selector
      official g Levf;g(I)Levf$b;
      intermediary method_44547 Lnet/minecraft/class_7555;method_44547(I)Lnet/minecraft/class_7555$class_7556;
      named streamBackward Lnet/minecraft/client/report/log/ChatLog;streamBackward(I)Lnet/minecraft/client/report/log/ChatLog$Streams;
    • streamForward

      default ChatLog.Streams streamForward(int startIndex, int endIndex)
      Returns the streams starting from startIndex with entires ordered chronologically (in ascending order) up to and including endIndex.
      Returns:
      the streams starting from startIndex with entires ordered chronologically (in ascending order) up to and including endIndex
      Implementation Note:
      If either startIndex or endIndex is not in the log, this returns emptyStreams().
      Mappings:
      Namespace Name Mixin selector
      official b Levf;b(II)Levf$b;
      intermediary method_44541 Lnet/minecraft/class_7555;method_44541(II)Lnet/minecraft/class_7555$class_7556;
      named streamForward Lnet/minecraft/client/report/log/ChatLog;streamForward(II)Lnet/minecraft/client/report/log/ChatLog$Streams;
    • stream

      default ChatLog.Streams stream(int startIndex, IntUnaryOperator nextIndexGetter)
      Returns the streams starting from startIndex.
      Parameters:
      nextIndexGetter - a function that, when given an index, returns the next index or -1 to indicate the end of the stream
      Returns:
      the streams starting from startIndex
      Implementation Note:
      If startIndex is not in the log, this returns emptyStreams().
      Mappings:
      Namespace Name Mixin selector
      official a Levf;a(ILjava/util/function/IntUnaryOperator;)Levf$b;
      intermediary method_44534 Lnet/minecraft/class_7555;method_44534(ILjava/util/function/IntUnaryOperator;)Lnet/minecraft/class_7555$class_7556;
      named stream Lnet/minecraft/client/report/log/ChatLog;stream(ILjava/util/function/IntUnaryOperator;)Lnet/minecraft/client/report/log/ChatLog$Streams;
    • emptyStreams

      private ChatLog.Streams emptyStreams()
      Returns the empty stream.
      Returns:
      the empty stream
      Mappings:
      Namespace Name Mixin selector
      official e Levf;e()Levf$b;
      intermediary method_44542 Lnet/minecraft/class_7555;method_44542()Lnet/minecraft/class_7555$class_7556;
      named emptyStreams Lnet/minecraft/client/report/log/ChatLog;emptyStreams()Lnet/minecraft/client/report/log/ChatLog$Streams;