Package net.minecraft.client.report.log
Class ChatLogImpl
java.lang.Object
net.minecraft.client.report.log.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 entry at the
index is overwritten. If the index goes above the array size, the array index wraps
around but the entry 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 evlintermediary net/minecraft/class_7561named net/minecraft/client/report/log/ChatLogImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.report.log.ChatLog
ChatLog.IndexedEntry<T extends ChatLogEntry>, ChatLog.Streams -
Field Summary
FieldsFields inherited from interface net.minecraft.client.report.log.ChatLog
MISSING_NEXT_INDEX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ChatLogEntry entry) Addsentryto the log.booleancontains(int index) Returns whether the log contains an entry with indexindex.get(int index) Returns the entry with indexindex, ornullif there is no such entry in the log.intReturns the maximum index currently used within the log.intReturns the minimum index currently used within the log.intgetOffsetIndex(int index, int offset) Returns the index offset byoffsetif there is an entry with that index, or -1 if there is no entry with the offset index.private intReturns the incremented index.private intwrapIndex(int index) Returns the entryindexwrapped for accessing the backing array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.report.log.ChatLog
getIndexed, getNextIndex, getPreviousIndex, stream, streamBackward, streamBackward, streamForward, streamForward, streamForward
-
Field Details
-
entries
- Mappings:
Namespace Name Mixin selector official bLevl;b:[Levi;intermediary field_39638Lnet/minecraft/class_7561;field_39638:[Lnet/minecraft/class_7629;named entriesLnet/minecraft/client/report/log/ChatLogImpl;entries:[Lnet/minecraft/client/report/log/ChatLogEntry;
-
maxIndex
private int maxIndex- Mappings:
Namespace Name Mixin selector official cLevl;c:Iintermediary field_39639Lnet/minecraft/class_7561;field_39639:Inamed maxIndexLnet/minecraft/client/report/log/ChatLogImpl;maxIndex:I
-
minIndex
private int minIndex- Mappings:
Namespace Name Mixin selector official dLevl;d:Iintermediary field_39640Lnet/minecraft/class_7561;field_39640:Inamed minIndexLnet/minecraft/client/report/log/ChatLogImpl;minIndex:I
-
-
Constructor Details
-
ChatLogImpl
public ChatLogImpl(int maxEntries) - Mappings:
Namespace Name Mixin selector official <init>Levl;<init>(I)Vintermediary <init>Lnet/minecraft/class_7561;<init>(I)Vnamed <init>Lnet/minecraft/client/report/log/ChatLogImpl;<init>(I)V
-
-
Method Details
-
add
Addsentryto the log.- Specified by:
addin interfaceChatLog- Mappings:
Namespace Name Mixin selector official aLevf;a(Levi;)Vintermediary method_44535Lnet/minecraft/class_7555;method_44535(Lnet/minecraft/class_7629;)Vnamed addLnet/minecraft/client/report/log/ChatLog;add(Lnet/minecraft/client/report/log/ChatLogEntry;)V
-
incrementIndex
private int incrementIndex()Returns the incremented index.- Returns:
- the incremented index
- Implementation Note:
- This always increments
maxIndex, and incrementsminIndexonly if the array is already full. - Mappings:
Namespace Name Mixin selector official eLevl;e()Iintermediary method_44559Lnet/minecraft/class_7561;method_44559()Inamed incrementIndexLnet/minecraft/client/report/log/ChatLogImpl;incrementIndex()I
-
get
Returns the entry with indexindex, ornullif there is no such entry in the log.- Specified by:
getin interfaceChatLog- Returns:
- the entry with index
index, ornullif there is no such entry in the log - Mappings:
Namespace Name Mixin selector official aLevf;a(I)Levi;intermediary method_44532Lnet/minecraft/class_7555;method_44532(I)Lnet/minecraft/class_7629;named getLnet/minecraft/client/report/log/ChatLog;get(I)Lnet/minecraft/client/report/log/ChatLogEntry;
-
wrapIndex
private int wrapIndex(int index) Returns the entryindexwrapped for accessing the backing array.- Returns:
- the entry
indexwrapped for accessing the backing array - Mappings:
Namespace Name Mixin selector official hLevl;h(I)Iintermediary method_44560Lnet/minecraft/class_7561;method_44560(I)Inamed wrapIndexLnet/minecraft/client/report/log/ChatLogImpl;wrapIndex(I)I
-
contains
public boolean contains(int index) Returns whether the log contains an entry with indexindex.- Specified by:
containsin interfaceChatLog- Returns:
- whether the log contains an entry with index
index - Mappings:
Namespace Name Mixin selector official cLevf;c(I)Zintermediary method_44540Lnet/minecraft/class_7555;method_44540(I)Znamed containsLnet/minecraft/client/report/log/ChatLog;contains(I)Z
-
getOffsetIndex
public int getOffsetIndex(int index, int offset) Returns the index offset byoffsetif there is an entry with that index, or -1 if there is no entry with the offset index.- Specified by:
getOffsetIndexin interfaceChatLog- Returns:
- the index offset by
offsetif there is an entry with that index, or -1 if there is no entry with the offset index - Mappings:
Namespace Name Mixin selector official aLevf;a(II)Iintermediary method_44533Lnet/minecraft/class_7555;method_44533(II)Inamed getOffsetIndexLnet/minecraft/client/report/log/ChatLog;getOffsetIndex(II)I
-
getMaxIndex
public 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.
- Specified by:
getMaxIndexin interfaceChatLog- Returns:
- the maximum index currently used within the log
- Mappings:
Namespace Name Mixin selector official aLevf;a()Iintermediary method_44531Lnet/minecraft/class_7555;method_44531()Inamed getMaxIndexLnet/minecraft/client/report/log/ChatLog;getMaxIndex()I
-
getMinIndex
public 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.
- Specified by:
getMinIndexin interfaceChatLog- Returns:
- the minimum index currently used within the log
- Mappings:
Namespace Name Mixin selector official bLevf;b()Iintermediary method_44536Lnet/minecraft/class_7555;method_44536()Inamed getMinIndexLnet/minecraft/client/report/log/ChatLog;getMinIndex()I
-