Class ChatScreen

All Implemented Interfaces:
Drawable, Element, Navigable, ParentElement
Direct Known Subclasses:
SleepingChatScreen

@Environment(CLIENT) public class ChatScreen extends Screen
A screen that allows player to input a chat message. It can be opened by pressing the chat key or the command key.
See Also:
Mappings:
Namespace Name
named net/minecraft/client/gui/screen/ChatScreen
intermediary net/minecraft/class_408
official fmt
  • Field Details

    • SHIFT_SCROLL_AMOUNT

      public static final double SHIFT_SCROLL_AMOUNT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SHIFT_SCROLL_AMOUNT Lnet/minecraft/client/gui/screen/ChatScreen;SHIFT_SCROLL_AMOUNT:D
      intermediary field_32237 Lnet/minecraft/class_408;field_32237:D
      official a Lfmt;a:D
    • USAGE_TEXT

      private static final Text USAGE_TEXT
      Mappings:
      Namespace Name Mixin selector
      named USAGE_TEXT Lnet/minecraft/client/gui/screen/ChatScreen;USAGE_TEXT:Lnet/minecraft/text/Text;
      intermediary field_33953 Lnet/minecraft/class_408;field_33953:Lnet/minecraft/class_2561;
      official c Lfmt;c:Lwy;
    • MAX_INDICATOR_TOOLTIP_WIDTH

      private static final int MAX_INDICATOR_TOOLTIP_WIDTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_INDICATOR_TOOLTIP_WIDTH Lnet/minecraft/client/gui/screen/ChatScreen;MAX_INDICATOR_TOOLTIP_WIDTH:I
      intermediary field_39774 Lnet/minecraft/class_408;field_39774:I
      official q Lfmt;q:I
    • chatLastMessage

      private String chatLastMessage
      Mappings:
      Namespace Name Mixin selector
      named chatLastMessage Lnet/minecraft/client/gui/screen/ChatScreen;chatLastMessage:Ljava/lang/String;
      intermediary field_2389 Lnet/minecraft/class_408;field_2389:Ljava/lang/String;
      official r Lfmt;r:Ljava/lang/String;
    • messageHistoryIndex

      private int messageHistoryIndex
      Mappings:
      Namespace Name Mixin selector
      named messageHistoryIndex Lnet/minecraft/client/gui/screen/ChatScreen;messageHistoryIndex:I
      intermediary field_2387 Lnet/minecraft/class_408;field_2387:I
      official s Lfmt;s:I
    • chatField

      protected TextFieldWidget chatField
      Mappings:
      Namespace Name Mixin selector
      named chatField Lnet/minecraft/client/gui/screen/ChatScreen;chatField:Lnet/minecraft/client/gui/widget/TextFieldWidget;
      intermediary field_2382 Lnet/minecraft/class_408;field_2382:Lnet/minecraft/class_342;
      official b Lfmt;b:Lfip;
    • originalChatText

      private String originalChatText
      Mappings:
      Namespace Name Mixin selector
      named originalChatText Lnet/minecraft/client/gui/screen/ChatScreen;originalChatText:Ljava/lang/String;
      intermediary field_18973 Lnet/minecraft/class_408;field_18973:Ljava/lang/String;
      official u Lfmt;u:Ljava/lang/String;
    • chatInputSuggestor

      ChatInputSuggestor chatInputSuggestor
      Mappings:
      Namespace Name Mixin selector
      named chatInputSuggestor Lnet/minecraft/client/gui/screen/ChatScreen;chatInputSuggestor:Lnet/minecraft/client/gui/screen/ChatInputSuggestor;
      intermediary field_21616 Lnet/minecraft/class_408;field_21616:Lnet/minecraft/class_4717;
      official v Lfmt;v:Lfij;
  • Constructor Details

    • ChatScreen

      public ChatScreen(String originalChatText)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/gui/screen/ChatScreen;<init>(Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_408;<init>(Ljava/lang/String;)V
      official <init> Lfmt;<init>(Ljava/lang/String;)V
  • Method Details

    • init

      protected void init()
      Called when a screen should be initialized.

      This method is called when this screen is opened or resized.

      This should call setInitialFocus() to set the element that is initially focused.

      Overrides:
      init in class Screen
      Mappings:
      Namespace Name Mixin selector
      named init Lnet/minecraft/client/gui/screen/Screen;init()V
      intermediary method_25426 Lnet/minecraft/class_437;method_25426()V
      official aP_ Lfnx;aP_()V
    • setInitialFocus

      protected void setInitialFocus()
      Overrides:
      setInitialFocus in class Screen
      Mappings:
      Namespace Name Mixin selector
      named setInitialFocus Lnet/minecraft/client/gui/screen/Screen;setInitialFocus()V
      intermediary method_56131 Lnet/minecraft/class_437;method_56131()V
      official aE_ Lfnx;aE_()V
    • resize

      public void resize(MinecraftClient client, int width, int height)
      Overrides:
      resize in class Screen
      Mappings:
      Namespace Name Mixin selector
      named resize Lnet/minecraft/client/gui/screen/Screen;resize(Lnet/minecraft/client/MinecraftClient;II)V
      intermediary method_25410 Lnet/minecraft/class_437;method_25410(Lnet/minecraft/class_310;II)V
      official a Lfnx;a(Lfgi;II)V
    • removed

      public void removed()
      Overrides:
      removed in class Screen
      Mappings:
      Namespace Name Mixin selector
      named removed Lnet/minecraft/client/gui/screen/Screen;removed()V
      intermediary method_25432 Lnet/minecraft/class_437;method_25432()V
      official j Lfnx;j()V
    • onChatFieldUpdate

      private void onChatFieldUpdate(String chatText)
      Mappings:
      Namespace Name Mixin selector
      named onChatFieldUpdate Lnet/minecraft/client/gui/screen/ChatScreen;onChatFieldUpdate(Ljava/lang/String;)V
      intermediary method_23945 Lnet/minecraft/class_408;method_23945(Ljava/lang/String;)V
      official b Lfmt;b(Ljava/lang/String;)V
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Callback for when a key down event has been captured. The key code is identified by the constants in GLFW class.
      Specified by:
      keyPressed in interface Element
      Specified by:
      keyPressed in interface ParentElement
      Overrides:
      keyPressed in class Screen
      Parameters:
      keyCode - the named key code of the event as described in the GLFW class
      scanCode - the unique/platform-specific scan code of the keyboard input
      modifiers - a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named keyPressed Lnet/minecraft/client/gui/Element;keyPressed(III)Z
      intermediary method_25404 Lnet/minecraft/class_364;method_25404(III)Z
      official a Lfkc;a(III)Z
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
      Callback for when a mouse button scroll event has been captured.
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      horizontalAmount - the horizontal scroll amount
      verticalAmount - the vertical scroll amount
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named mouseScrolled Lnet/minecraft/client/gui/Element;mouseScrolled(DDDD)Z
      intermediary method_25401 Lnet/minecraft/class_364;method_25401(DDDD)Z
      official a Lfkc;a(DDDD)Z
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Callback for when a mouse button down event has been captured. The button number is identified by the constants in GLFW class.
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named mouseClicked Lnet/minecraft/client/gui/Element;mouseClicked(DDI)Z
      intermediary method_25402 Lnet/minecraft/class_364;method_25402(DDI)Z
      official a Lfkc;a(DDI)Z
    • insertText

      protected void insertText(String text, boolean override)
      Overrides:
      insertText in class Screen
      Mappings:
      Namespace Name Mixin selector
      named insertText Lnet/minecraft/client/gui/screen/Screen;insertText(Ljava/lang/String;Z)V
      intermediary method_25415 Lnet/minecraft/class_437;method_25415(Ljava/lang/String;Z)V
      official a_ Lfnx;a_(Ljava/lang/String;Z)V
    • setChatFromHistory

      public void setChatFromHistory(int offset)
      Mappings:
      Namespace Name Mixin selector
      named setChatFromHistory Lnet/minecraft/client/gui/screen/ChatScreen;setChatFromHistory(I)V
      intermediary method_2114 Lnet/minecraft/class_408;method_2114(I)V
      official a Lfmt;a(I)V
    • render

      public void render(DrawContext context, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface Drawable
      Overrides:
      render in class Screen
      Mappings:
      Namespace Name Mixin selector
      named render Lnet/minecraft/client/gui/Drawable;render(Lnet/minecraft/client/gui/DrawContext;IIF)V
      intermediary method_25394 Lnet/minecraft/class_4068;method_25394(Lnet/minecraft/class_332;IIF)V
      official a Lfjj;a(Lfht;IIF)V
    • renderBackground

      public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta)
      Renders the background of this screen.

      If the client is in a world, renders the translucent background gradient. Otherwise renders the background texture.

      Overrides:
      renderBackground in class Screen
      Mappings:
      Namespace Name Mixin selector
      named renderBackground Lnet/minecraft/client/gui/screen/Screen;renderBackground(Lnet/minecraft/client/gui/DrawContext;IIF)V
      intermediary method_25420 Lnet/minecraft/class_437;method_25420(Lnet/minecraft/class_332;IIF)V
      official b Lfnx;b(Lfht;IIF)V
    • shouldPause

      public boolean shouldPause()
      Overrides:
      shouldPause in class Screen
      Mappings:
      Namespace Name Mixin selector
      named shouldPause Lnet/minecraft/client/gui/screen/Screen;shouldPause()Z
      intermediary method_25421 Lnet/minecraft/class_437;method_25421()Z
      official k Lfnx;k()Z
    • setText

      private void setText(String text)
      Mappings:
      Namespace Name Mixin selector
      named setText Lnet/minecraft/client/gui/screen/ChatScreen;setText(Ljava/lang/String;)V
      intermediary method_2108 Lnet/minecraft/class_408;method_2108(Ljava/lang/String;)V
      official c Lfmt;c(Ljava/lang/String;)V
    • addScreenNarrations

      protected void addScreenNarrations(NarrationMessageBuilder messageBuilder)
      Overrides:
      addScreenNarrations in class Screen
      Mappings:
      Namespace Name Mixin selector
      named addScreenNarrations Lnet/minecraft/client/gui/screen/Screen;addScreenNarrations(Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;)V
      intermediary method_37062 Lnet/minecraft/class_437;method_37062(Lnet/minecraft/class_6382;)V
      official a Lfnx;a(Lfmc;)V
    • getTextStyleAt

      @Nullable private @Nullable Style getTextStyleAt(double x, double y)
      Mappings:
      Namespace Name Mixin selector
      named getTextStyleAt Lnet/minecraft/client/gui/screen/ChatScreen;getTextStyleAt(DD)Lnet/minecraft/text/Style;
      intermediary method_44052 Lnet/minecraft/class_408;method_44052(DD)Lnet/minecraft/class_2583;
      official b Lfmt;b(DD)Lxv;
    • sendMessage

      public void sendMessage(String chatText, boolean addToHistory)
      Mappings:
      Namespace Name Mixin selector
      named sendMessage Lnet/minecraft/client/gui/screen/ChatScreen;sendMessage(Ljava/lang/String;Z)V
      intermediary method_44056 Lnet/minecraft/class_408;method_44056(Ljava/lang/String;Z)V
      official b Lfmt;b(Ljava/lang/String;Z)V
    • normalize

      public String normalize(String chatText)
      Returns the message normalized by trimming it and then normalizing spaces.
      Returns:
      the message normalized by trimming it and then normalizing spaces
      Mappings:
      Namespace Name Mixin selector
      named normalize Lnet/minecraft/client/gui/screen/ChatScreen;normalize(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_44054 Lnet/minecraft/class_408;method_44054(Ljava/lang/String;)Ljava/lang/String;
      official a Lfmt;a(Ljava/lang/String;)Ljava/lang/String;