Class ChatComponent

java.lang.Object
net.minecraft.client.gui.components.ChatComponent

public class ChatComponent extends Object
  • 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

      private static final Component DELETED_CHAT_MESSAGE
    • minecraft

      private final Minecraft minecraft
    • recentChat

      private final ArrayListDeque<String> recentChat
      A list of messages previously sent through the chat GUI
    • allMessages

      private final List<GuiMessage> allMessages
      Chat lines to be displayed in the chat box
    • trimmedMessages

      private final List<GuiMessage.Line> trimmedMessages
      List of the ChatLines currently drawn
    • chatScrollbarPos

      private int chatScrollbarPos
    • newMessageSinceScroll

      private boolean newMessageSinceScroll
    • messageDeletionQueue

      private final List<ChatComponent.DelayedMessageDeletion> messageDeletionQueue
  • Constructor Details

    • ChatComponent

      public ChatComponent(Minecraft pMinecraft)
  • Method Details

    • tick

      public void tick()
    • render

      public void render(GuiGraphics pGuiGraphics, int pTickCount, int pMouseX, int pMouseY, boolean pFocused)
    • drawTagIcon

      private void drawTagIcon(GuiGraphics pGuiGraphics, int pLeft, int pBottom, GuiMessageTag.Icon pTagIcon)
    • getTagIconLeft

      private int getTagIconLeft(GuiMessage.Line pLine)
    • isChatHidden

      private boolean isChatHidden()
    • getTimeFactor

      private static double getTimeFactor(int pCounter)
    • clearMessages

      public void clearMessages(boolean pClearSentMsgHistory)
      Clears the chat.
      Parameters:
      pClearSentMsgHistory - Whether to clear the user's sent message history
    • addMessage

      public void addMessage(Component pChatComponent)
    • addMessage

      public void addMessage(Component pChatComponent, @Nullable MessageSignature pHeaderSignature, @Nullable GuiMessageTag pTag)
    • logChatMessage

      private void logChatMessage(GuiMessage pMessage)
    • addMessageToDisplayQueue

      private void addMessageToDisplayQueue(GuiMessage pMessage)
    • addMessageToQueue

      private void addMessageToQueue(GuiMessage pMessage)
    • processMessageDeletionQueue

      private void processMessageDeletionQueue()
    • deleteMessage

      public void deleteMessage(MessageSignature pMessageSignature)
    • deleteMessageOrDelay

      @Nullable private ChatComponent.DelayedMessageDeletion deleteMessageOrDelay(MessageSignature pMessageSignature)
    • createDeletedMarker

      private GuiMessage createDeletedMarker(GuiMessage pMessage)
    • rescaleChat

      public void rescaleChat()
    • refreshTrimmedMessages

      private void refreshTrimmedMessages()
    • getRecentChat

      public ArrayListDeque<String> getRecentChat()
    • addRecentChat

      public void addRecentChat(String pMessage)
      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)
    • handleChatQueueClicked

      public boolean handleChatQueueClicked(double pMouseX, double pMouseY)
    • getClickedComponentStyleAt

      @Nullable public Style getClickedComponentStyleAt(double pMouseX, double pMouseY)
    • getMessageTagAt

      @Nullable public GuiMessageTag getMessageTagAt(double pMouseX, double pMouseY)
    • hasSelectedMessageTag

      private boolean hasSelectedMessageTag(double pX, GuiMessage.Line pLine, GuiMessageTag pTag)
    • screenToChatX

      private double screenToChatX(double pX)
    • screenToChatY

      private double screenToChatY(double pY)
    • getMessageEndIndexAt

      private int getMessageEndIndexAt(double pMouseX, double pMouseY)
    • getMessageLineIndexAt

      private int getMessageLineIndexAt(double pMouseX, double pMouseY)
    • isChatFocused

      public boolean isChatFocused()
    • getWidth

      public int getWidth()
    • getHeight

      public 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()
    • storeState

      public ChatComponent.State storeState()
    • restoreState

      public void restoreState(ChatComponent.State pState)