Class ChatComponent
java.lang.Object
net.minecraft.client.gui.components.ChatComponent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfacestatic interfacestatic enum(package private) static class(package private) static final recordstatic final record(package private) static class(package private) static class(package private) static interfacestatic 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 @Nullable ChatComponent.Draftprivate static final org.slf4j.Loggerprivate static final intstatic final intprivate static final intprivate final List<ChatComponent.DelayedMessageDeletion> (package private) final Minecraftprivate booleanprivate @Nullable ChatScreenstatic final Identifierprivate static final Styleprivate final ArrayListDeque<String> A list of messages previously sent through the chat GUIprivate static final intprivate static final intprivate final List<GuiMessage.Line> List of the ChatLines currently drawn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(Component pChatComponent) voidaddMessage(Component pChatComponent, @Nullable MessageSignature pHeaderSignature, @Nullable GuiMessageTag pTag) private voidaddMessageToDisplayQueue(GuiMessage pMessage) private voidaddMessageToQueue(GuiMessage pMessage) voidaddRecentChat(String pMessage) Adds this string to the list of sent messages, for recall using the up/down arrow keysvoidcaptureClickableText(ActiveTextCollector pActiveTextCollector, int pHeight, int pTickCount, boolean pFocused) voidclearMessages(boolean pClearSentMsgHistory) Clears the chat.private GuiMessagecreateDeletedMarker(GuiMessage pMessage) <T extends ChatScreen>
TcreateScreen(ChatComponent.ChatMethod pMethod, ChatScreen.ChatConstructor<T> pConstructor) static doublevoiddeleteMessage(MessageSignature pMessageSignature) private @Nullable ChatComponent.DelayedMessageDeletiondeleteMessageOrDelay(MessageSignature pMessageSignature) voidprivate intforEachLine(ChatComponent.AlphaCalculator pAlphaCalculator, ChatComponent.LineConsumer pAction) private intstatic intgetHeight(double pHeight) private intintdoublegetScale()private intgetWidth()static intgetWidth(double pWidth) booleanprivate booleanprivate voidlogChatMessage(GuiMessage pMessage) voidopenScreen(ChatComponent.ChatMethod pMethod, ChatScreen.ChatConstructor<?> pConstructor) voidprivate voidprivate voidprivate voidrender(ChatComponent.ChatGraphicsAccess pChatGraphicsAccess, int pHeight, int pTickCount, boolean pFocused) voidrender(GuiGraphics pGraphics, Font pFont, int pTickCount, int pGlobalMouseX, int pGlobalMouseY, boolean pFocused, boolean pChangeCursorOnInsertions) voidvoid@Nullable ChatScreenvoidrestoreState(ChatComponent.State pState) voidsaveAsDraft(String pText) voidscrollChat(int pPosInc) voidtick()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_CHAT_HISTORY
private static final int MAX_CHAT_HISTORY- See Also:
-
MESSAGE_INDENT
private static final int MESSAGE_INDENT- See Also:
-
BOTTOM_MARGIN
private static final int BOTTOM_MARGIN- See Also:
-
TOOLTIP_MAX_WIDTH
private static final int TOOLTIP_MAX_WIDTH- See Also:
-
TIME_BEFORE_MESSAGE_DELETION
private static final int TIME_BEFORE_MESSAGE_DELETION- See Also:
-
DELETED_CHAT_MESSAGE
-
MESSAGE_BOTTOM_TO_MESSAGE_TOP
public static final int MESSAGE_BOTTOM_TO_MESSAGE_TOP- See Also:
-
QUEUE_EXPAND_ID
-
QUEUE_EXPAND_TEXT_STYLE
-
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 -
latestDraft
-
preservedScreen
-
messageDeletionQueue
-
-
Constructor Details
-
ChatComponent
-
-
Method Details
-
tick
public void tick() -
forEachLine
private int forEachLine(ChatComponent.AlphaCalculator pAlphaCalculator, ChatComponent.LineConsumer pAction) -
render
public void render(GuiGraphics pGraphics, Font pFont, int pTickCount, int pGlobalMouseX, int pGlobalMouseY, boolean pFocused, boolean pChangeCursorOnInsertions) -
captureClickableText
public void captureClickableText(ActiveTextCollector pActiveTextCollector, int pHeight, int pTickCount, boolean pFocused) -
render
private void render(ChatComponent.ChatGraphicsAccess pChatGraphicsAccess, int pHeight, int pTickCount, boolean pFocused) -
isChatHidden
private boolean isChatHidden() -
clearMessages
public void clearMessages(boolean pClearSentMsgHistory) Clears the chat.- Parameters:
pClearSentMsgHistory- Whether to clear the user's sent message history
-
addMessage
-
addMessage
public void addMessage(Component pChatComponent, @Nullable MessageSignature pHeaderSignature, @Nullable GuiMessageTag pTag) -
logChatMessage
-
addMessageToDisplayQueue
-
addMessageToQueue
-
processMessageDeletionQueue
private void processMessageDeletionQueue() -
deleteMessage
-
deleteMessageOrDelay
private @Nullable ChatComponent.DelayedMessageDeletion deleteMessageOrDelay(MessageSignature pMessageSignature) -
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 pPosInc) -
isChatFocused
public boolean isChatFocused() -
getWidth
private int getWidth() -
getHeight
private int getHeight() -
getScale
public double getScale() -
getWidth
public static int getWidth(double pWidth) -
getHeight
public static int getHeight(double pHeight) -
defaultUnfocusedPct
public static double defaultUnfocusedPct() -
getLinesPerPage
public int getLinesPerPage() -
getLineHeight
private int getLineHeight() -
saveAsDraft
-
discardDraft
public void discardDraft() -
createScreen
public <T extends ChatScreen> T createScreen(ChatComponent.ChatMethod pMethod, ChatScreen.ChatConstructor<T> pConstructor) -
openScreen
public void openScreen(ChatComponent.ChatMethod pMethod, ChatScreen.ChatConstructor<?> pConstructor) -
preserveCurrentChatScreen
public void preserveCurrentChatScreen() -
restoreChatScreen
-
storeState
-
restoreState
-