Class ChatComponent
java.lang.Object
net.minecraft.client.gui.components.ChatComponent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<GuiMessage> Chat lines to be displayed in the chat boxprivate static final intprivate intprivate static final Componentprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate static final intprivate static final intprivate final List<ChatComponent.DelayedMessageDeletion> private final Minecraftprivate booleanprivate final ArrayListDeque<String> A list of messages previously sent through the chat GUIprivate static final intprivate final List<GuiMessage.Line> List of the ChatLines currently drawn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(Component chatComponent) voidaddMessage(Component chatComponent, MessageSignature headerSignature, GuiMessageTag tag) private voidaddMessageToDisplayQueue(GuiMessage message) private voidaddMessageToQueue(GuiMessage message) voidaddRecentChat(String message) Adds this string to the list of sent messages, for recall using the up/down arrow keysvoidclearMessages(boolean clearSentMsgHistory) Clears the chat.private GuiMessagecreateDeletedMarker(GuiMessage message) static doublevoiddeleteMessage(MessageSignature messageSignature) deleteMessageOrDelay(MessageSignature messageSignature) private voiddrawTagIcon(GuiGraphics guiGraphics, int left, int bottom, GuiMessageTag.Icon tagIcon) getClickedComponentStyleAt(double mouseX, double mouseY) intstatic intgetHeight(double height) private intintprivate intgetMessageEndIndexAt(double mouseX, double mouseY) private intgetMessageLineIndexAt(double mouseX, double mouseY) getMessageTagAt(double mouseX, double mouseY) doublegetScale()private intprivate static doublegetTimeFactor(int counter) intgetWidth()static intgetWidth(double width) booleanhandleChatQueueClicked(double mouseX, double mouseY) private booleanhasSelectedMessageTag(double x, GuiMessage.Line line, GuiMessageTag tag) booleanprivate booleanprivate voidlogChatMessage(GuiMessage message) private voidprivate voidvoidrender(GuiGraphics guiGraphics, int tickCount, int mouseX, int mouseY, boolean focused) voidvoidvoidrestoreState(ChatComponent.State state) private doublescreenToChatX(double x) private doublescreenToChatY(double y) voidscrollChat(int posInc) voidtick()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_CHAT_HISTORY
private static final int MAX_CHAT_HISTORY- See Also:
-
MESSAGE_NOT_FOUND
private static final int MESSAGE_NOT_FOUND- See Also:
-
MESSAGE_INDENT
private static final int MESSAGE_INDENT- See Also:
-
MESSAGE_TAG_MARGIN_LEFT
private static final int MESSAGE_TAG_MARGIN_LEFT- See Also:
-
BOTTOM_MARGIN
private static final int BOTTOM_MARGIN- See Also:
-
TIME_BEFORE_MESSAGE_DELETION
private static final int TIME_BEFORE_MESSAGE_DELETION- See Also:
-
DELETED_CHAT_MESSAGE
-
minecraft
-
recentChat
A list of messages previously sent through the chat GUI -
allMessages
Chat lines to be displayed in the chat box -
trimmedMessages
List of the ChatLines currently drawn -
chatScrollbarPos
private int chatScrollbarPos -
newMessageSinceScroll
private boolean newMessageSinceScroll -
messageDeletionQueue
-
-
Constructor Details
-
ChatComponent
-
-
Method Details
-
tick
public void tick() -
render
-
drawTagIcon
-
getTagIconLeft
-
isChatHidden
private boolean isChatHidden() -
getTimeFactor
private static double getTimeFactor(int counter) -
clearMessages
public void clearMessages(boolean clearSentMsgHistory) Clears the chat.- Parameters:
clearSentMsgHistory- Whether to clear the user's sent message history
-
addMessage
-
addMessage
public void addMessage(Component chatComponent, @Nullable MessageSignature headerSignature, @Nullable GuiMessageTag tag) -
logChatMessage
-
addMessageToDisplayQueue
-
addMessageToQueue
-
processMessageDeletionQueue
private void processMessageDeletionQueue() -
deleteMessage
-
deleteMessageOrDelay
@Nullable private ChatComponent.DelayedMessageDeletion deleteMessageOrDelay(MessageSignature messageSignature) -
createDeletedMarker
-
rescaleChat
public void rescaleChat() -
refreshTrimmedMessages
private void refreshTrimmedMessages() -
getRecentChat
-
addRecentChat
Adds this string to the list of sent messages, for recall using the up/down arrow keys -
resetChatScroll
public void resetChatScroll() -
scrollChat
public void scrollChat(int posInc) -
handleChatQueueClicked
public boolean handleChatQueueClicked(double mouseX, double mouseY) -
getClickedComponentStyleAt
-
getMessageTagAt
-
hasSelectedMessageTag
-
screenToChatX
private double screenToChatX(double x) -
screenToChatY
private double screenToChatY(double y) -
getMessageEndIndexAt
private int getMessageEndIndexAt(double mouseX, double mouseY) -
getMessageLineIndexAt
private int getMessageLineIndexAt(double mouseX, double mouseY) -
isChatFocused
public boolean isChatFocused() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getScale
public double getScale() -
getWidth
public static int getWidth(double width) -
getHeight
public static int getHeight(double height) -
defaultUnfocusedPct
public static double defaultUnfocusedPct() -
getLinesPerPage
public int getLinesPerPage() -
getLineHeight
private int getLineHeight() -
storeState
-
restoreState
-