Package net.minecraft.client.report
Class ChatLogImpl
java.lang.Object
net.minecraft.client.report.ChatLogImpl
- All Implemented Interfaces:
ChatLog
An implementation of
ChatLog
using a fixed-size array and 0
as the
starting index. When adding a log, the index is incremented, and the message at the
index is overwritten. If the index goes above the array size, the array index wraps
around but the message index is still incremented.
For example, if the size is 10
, after adding the 10th item, the next index is
10
because the log is 0-indexed. However, the next message will be stored at
messages[0]
. Use wrapIndex(int)
to calculate the wrapped index.
- Mappings:
Namespace Name official evg
intermediary net/minecraft/class_7561
named net/minecraft/client/report/ChatLogImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.report.ChatLog
ChatLog.IndexedMessage<T extends class_7629>, ChatLog.Streams
-
Field Summary
FieldsFields inherited from interface net.minecraft.client.report.ChatLog
MISSING_NEXT_INDEX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(class_7629 message) Addsmessage
to the log.boolean
contains
(int index) Returns whether the log contains a message with indexindex
.get
(int index) Returns the message with indexindex
, ornull
if there is no such message in the log.int
Returns the maximum index currently used within the log.int
Returns the minimum index currently used within the log.int
getOffsetIndex
(int index, int offset) Returns the index offset byoffset
if there is a message with that index, or -1 if there is no message with the offset index.private int
Returns the incremented index.private int
wrapIndex
(int index) Returns the messageindex
wrapped for accessing the backing array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.report.ChatLog
getIndexed, getNextIndex, getPreviousIndex, stream, streamBackward, streamBackward, streamForward, streamForward, streamForward
-
Field Details
-
messages
- Mappings:
Namespace Name Mixin selector official b
Levg;b:[Levd;
intermediary field_39638
Lnet/minecraft/class_7561;field_39638:[Lnet/minecraft/class_7629;
named messages
Lnet/minecraft/client/report/ChatLogImpl;messages:[Lnet/minecraft/class_7629;
-
maxIndex
private int maxIndex- Mappings:
Namespace Name Mixin selector official c
Levg;c:I
intermediary field_39639
Lnet/minecraft/class_7561;field_39639:I
named maxIndex
Lnet/minecraft/client/report/ChatLogImpl;maxIndex:I
-
minIndex
private int minIndex- Mappings:
Namespace Name Mixin selector official d
Levg;d:I
intermediary field_39640
Lnet/minecraft/class_7561;field_39640:I
named minIndex
Lnet/minecraft/client/report/ChatLogImpl;minIndex:I
-
-
Constructor Details
-
ChatLogImpl
public ChatLogImpl(int maxMessages) - Mappings:
Namespace Name Mixin selector official <init>
Levg;<init>(I)V
intermediary <init>
Lnet/minecraft/class_7561;<init>(I)V
named <init>
Lnet/minecraft/client/report/ChatLogImpl;<init>(I)V
-
-
Method Details
-
add
Addsmessage
to the log. -
incrementIndex
private int incrementIndex()Returns the incremented index.- Returns:
- the incremented index
- Implementation Note:
- This always increments
maxIndex
, and incrementsminIndex
only if the array is already full. - Mappings:
Namespace Name Mixin selector official e
Levg;e()I
intermediary method_44559
Lnet/minecraft/class_7561;method_44559()I
named incrementIndex
Lnet/minecraft/client/report/ChatLogImpl;incrementIndex()I
-
get
Returns the message with indexindex
, ornull
if there is no such message in the log.- Specified by:
get
in interfaceChatLog
- Returns:
- the message with index
index
, ornull
if there is no such message in the log - Mappings:
Namespace Name Mixin selector official a
Leva;a(I)Levd;
intermediary method_44532
Lnet/minecraft/class_7555;method_44532(I)Lnet/minecraft/class_7629;
named get
Lnet/minecraft/client/report/ChatLog;get(I)Lnet/minecraft/class_7629;
-
wrapIndex
private int wrapIndex(int index) Returns the messageindex
wrapped for accessing the backing array.- Returns:
- the message
index
wrapped for accessing the backing array - Mappings:
Namespace Name Mixin selector official h
Levg;h(I)I
intermediary method_44560
Lnet/minecraft/class_7561;method_44560(I)I
named wrapIndex
Lnet/minecraft/client/report/ChatLogImpl;wrapIndex(I)I
-
contains
public boolean contains(int index) Returns whether the log contains a message with indexindex
.- Specified by:
contains
in interfaceChatLog
- Returns:
- whether the log contains a message with index
index
- Mappings:
Namespace Name Mixin selector official c
Leva;c(I)Z
intermediary method_44540
Lnet/minecraft/class_7555;method_44540(I)Z
named contains
Lnet/minecraft/client/report/ChatLog;contains(I)Z
-
getOffsetIndex
public int getOffsetIndex(int index, int offset) Returns the index offset byoffset
if there is a message with that index, or -1 if there is no message with the offset index.- Specified by:
getOffsetIndex
in interfaceChatLog
- Returns:
- the index offset by
offset
if there is a message with that index, or -1 if there is no message with the offset index - Mappings:
Namespace Name Mixin selector official a
Leva;a(II)I
intermediary method_44533
Lnet/minecraft/class_7555;method_44533(II)I
named getOffsetIndex
Lnet/minecraft/client/report/ChatLog;getOffsetIndex(II)I
-
getMaxIndex
public int getMaxIndex()Returns the maximum index currently used within the log.This value changes every time a new message gets added. The message associated with this index is the newest one in the log.
- Specified by:
getMaxIndex
in interfaceChatLog
- Returns:
- the maximum index currently used within the log
- Mappings:
Namespace Name Mixin selector official a
Leva;a()I
intermediary method_44531
Lnet/minecraft/class_7555;method_44531()I
named getMaxIndex
Lnet/minecraft/client/report/ChatLog;getMaxIndex()I
-
getMinIndex
public int getMinIndex()Returns the minimum index currently used within the log.This value can change every time a new message gets added. The message associated with this index is the oldest one in the log.
- Specified by:
getMinIndex
in interfaceChatLog
- Returns:
- the minimum index currently used within the log
- Mappings:
Namespace Name Mixin selector official b
Leva;b()I
intermediary method_44536
Lnet/minecraft/class_7555;method_44536()I
named getMinIndex
Lnet/minecraft/client/report/ChatLog;getMinIndex()I
-