Class ChatSelectionScreen.ChatSelectionList.MessageEntry
java.lang.Object
net.minecraft.client.gui.components.AbstractSelectionList.Entry<ChatSelectionScreen.ChatSelectionList.Entry>
net.minecraft.client.gui.components.ObjectSelectionList.Entry<ChatSelectionScreen.ChatSelectionList.Entry>
net.minecraft.client.gui.screens.reporting.ChatSelectionScreen.ChatSelectionList.Entry
net.minecraft.client.gui.screens.reporting.ChatSelectionScreen.ChatSelectionList.MessageEntry
- All Implemented Interfaces:
GuiEventListener
,TabOrderedElement
,NarrationSupplier
- Enclosing class:
ChatSelectionScreen.ChatSelectionList
public class ChatSelectionScreen.ChatSelectionList.MessageEntry
extends ChatSelectionScreen.ChatSelectionList.Entry
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final int
private static final int
private static final int
private final List
<FormattedCharSequence> private static final int
private final Component
private final boolean
private static final int
private final List
<FormattedCharSequence> private final GuiMessageTag.Icon
private final FormattedText
Fields inherited from class net.minecraft.client.gui.components.AbstractSelectionList.Entry
list
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsConstructorDescriptionMessageEntry
(int pChatId, Component pText, Component pNarration, GuiMessageTag pTagIcon, boolean pCanReport, boolean pPlayerMessage) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
private int
private int
boolean
boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.boolean
mouseClicked
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.void
render
(GuiGraphics pGuiGraphics, int pIndex, int pTop, int pLeft, int pWidth, int pHeight, int pMouseX, int pMouseY, boolean pHovering, float pPartialTick) private void
renderSelectedCheckmark
(GuiGraphics pGuiGraphics, int pTop, int pLeft, int pHeight) private void
renderTag
(GuiGraphics pGuiGraphics, int pX, int pY, int pHeight, int pMouseX, int pMouseY) private boolean
Methods inherited from class net.minecraft.client.gui.components.ObjectSelectionList.Entry
updateNarration
Methods inherited from class net.minecraft.client.gui.components.AbstractSelectionList.Entry
isFocused, isMouseOver, renderBack, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getCurrentFocusPath, getRectangle, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
CHECKMARK_WIDTH
private static final int CHECKMARK_WIDTH- See Also:
-
CHECKMARK_HEIGHT
private static final int CHECKMARK_HEIGHT- See Also:
-
INDENT_AMOUNT
private static final int INDENT_AMOUNT- See Also:
-
TAG_MARGIN_LEFT
private static final int TAG_MARGIN_LEFT- See Also:
-
chatId
private final int chatId -
text
-
narration
-
hoverText
-
tagIcon
-
tagHoverText
-
canReport
private final boolean canReport -
playerMessage
private final boolean playerMessage
-
-
Constructor Details
-
MessageEntry
public MessageEntry(int pChatId, Component pText, Component pNarration, @Nullable GuiMessageTag pTagIcon, boolean pCanReport, boolean pPlayerMessage)
-
-
Method Details
-
render
public void render(GuiGraphics pGuiGraphics, int pIndex, int pTop, int pLeft, int pWidth, int pHeight, int pMouseX, int pMouseY, boolean pHovering, float pPartialTick) - Specified by:
render
in classAbstractSelectionList.Entry<ChatSelectionScreen.ChatSelectionList.Entry>
-
renderTag
private void renderTag(GuiGraphics pGuiGraphics, int pX, int pY, int pHeight, int pMouseX, int pMouseY) -
renderSelectedCheckmark
-
getMaximumTextWidth
private int getMaximumTextWidth() -
getTextIndent
private int getTextIndent() -
getNarration
- Overrides:
getNarration
in classChatSelectionScreen.ChatSelectionList.Entry
-
mouseClicked
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClicked
in interfaceGuiEventListener
- Overrides:
mouseClicked
in classObjectSelectionList.Entry<ChatSelectionScreen.ChatSelectionList.Entry>
- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Parameters:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
isSelected
public boolean isSelected()- Overrides:
isSelected
in classChatSelectionScreen.ChatSelectionList.Entry
-
canSelect
public boolean canSelect()- Overrides:
canSelect
in classChatSelectionScreen.ChatSelectionList.Entry
-
canReport
public boolean canReport()- Overrides:
canReport
in classChatSelectionScreen.ChatSelectionList.Entry
-
toggleReport
private boolean toggleReport()
-