Package net.minecraft.client.gui.screens
Class ChatScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.ChatScreen
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement
- Direct Known Subclasses:
InBedChatScreen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceChatScreen.ChatConstructor<T extends ChatScreen>protected static enumNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescription(package private) CommandSuggestionsprotected ChatScreen.ExitReasonprivate Stringprivate intkeeps position of which chat message you will select when you press up, (does not increase for duplicated messages sent immediately after each other)protected Stringis the text that appears when you press the chat key and the input box appears pre-filledprotected EditBoxChat entry fieldprotected booleanstatic final doubleprivate static final intprivate static final ComponentFields inherited from class net.minecraft.client.gui.screens.Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FormattedCharSequenceformatChat(String pText, int pDisplayPos) private StylegetComponentStyleAt(double pMouseX, double pMouseY) voidhandleChatInput(String pMessage, boolean pAddToRecentChat) protected voidinit()voidinsertText(String pText, boolean pOverwrite) booleanbooleanbooleankeyPressed(KeyEvent p_446285_) booleanmouseClicked(MouseButtonEvent p_446006_, boolean p_434924_) booleanmouseScrolled(double p_95581_, double p_95582_, double p_95583_, double p_295977_) voidmoveInHistory(int pMsgPos) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next message from the current cursor position.normalizeChatMessage(String pMessage) voidonClose()private voidvoidremoved()voidrender(GuiGraphics p_282470_, int p_282674_, int p_282014_, float p_283132_) Renders the graphical user interface (GUI) element.voidrenderBackground(GuiGraphics p_295929_, int p_296130_, int p_296353_, float p_294668_) voidprotected voidprotected booleanprotected voidupdateNarrationState(NarrationElementOutput p_169238_) Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleClickEvent, handleComponentClicked, handleDelayedNarration, init, isInGameUi, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarratorStatusMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseReleased, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
MOUSE_SCROLL_SPEED
public static final double MOUSE_SCROLL_SPEED- See Also:
-
USAGE_TEXT
-
TOOLTIP_MAX_WIDTH
private static final int TOOLTIP_MAX_WIDTH- See Also:
-
historyBuffer
-
historyPos
private int historyPoskeeps position of which chat message you will select when you press up, (does not increase for duplicated messages sent immediately after each other) -
input
Chat entry field -
initial
is the text that appears when you press the chat key and the input box appears pre-filled -
isDraft
protected boolean isDraft -
exitReason
-
commandSuggestions
CommandSuggestions commandSuggestions
-
-
Constructor Details
-
ChatScreen
-
-
Method Details
-
init
protected void init() -
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocusin classScreen
-
resize
-
onClose
public void onClose() -
removed
public void removed() -
shouldDiscardDraft
protected boolean shouldDiscardDraft() -
onEdited
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
mouseScrolled
public boolean mouseScrolled(double p_95581_, double p_95582_, double p_95583_, double p_295977_) -
mouseClicked
-
insertText
- Overrides:
insertTextin classScreen
-
moveInHistory
public void moveInHistory(int pMsgPos) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next message from the current cursor position. -
formatChat
-
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
p_282470_- the GuiGraphics object used for rendering.p_282674_- the x-coordinate of the mouse cursor.p_282014_- the y-coordinate of the mouse cursor.p_283132_- the partial tick time.
-
renderBackground
- Overrides:
renderBackgroundin classScreen
-
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreenin classScreen
-
isAllowedInPortal
public boolean isAllowedInPortal()- Overrides:
isAllowedInPortalin classScreen
-
updateNarrationState
- Overrides:
updateNarrationStatein classScreen
-
getComponentStyleAt
-
handleChatInput
-
normalizeChatMessage
-