Class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>>
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractContainerWidget
net.minecraft.client.gui.components.AbstractSelectionList<E>
- All Implemented Interfaces:
ContainerEventHandler
,GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
,IAbstractWidgetExtension
- Direct Known Subclasses:
ContainerObjectSelectionList
,ObjectSelectionList
public abstract class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>>
extends AbstractContainerWidget
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
(package private) class
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected int
private E
private static final ResourceLocation
protected final int
private static final ResourceLocation
protected final Minecraft
private boolean
private E
Fields inherited from class net.minecraft.client.gui.components.AbstractScrollArea
SCROLLBAR_WIDTH
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSelectionList
(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight) AbstractSelectionList
(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight, int pHeaderHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected void
addEntryToTop
(E pEntry) (package private) void
bindEntryToSelf
(AbstractSelectionList.Entry<E> pEntry) protected void
centerScrollOn
(E pEntry) children()
protected void
protected int
protected void
enableScissor
(GuiGraphics pGuiGraphics) protected void
ensureVisible
(E pEntry) getChildAt
(double pMouseX, double pMouseY) Returns the first event listener that intersects with the mouse coordinates.protected E
getEntry
(int pIndex) protected final E
getEntryAtPosition
(double pMouseX, double pMouseY) protected E
protected int
int
getRowBottom
(int pIndex) int
int
int
getRowTop
(int pIndex) int
protected boolean
isSelectedItem
(int pIndex) protected void
narrateListElementPosition
(NarrationElementOutput pNarrationElementOutput, E pEntry) protected E
nextEntry
(ScreenDirection pDirection) protected E
nextEntry
(ScreenDirection pDirection, Predicate<E> pPredicate) protected E
nextEntry
(ScreenDirection pDirection, Predicate<E> pPredicate, E pSelected) protected E
remove
(int pIndex) protected boolean
removeEntry
(E pEntry) protected boolean
removeEntryFromTop
(E pEntry) protected void
renderDecorations
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY) protected void
renderHeader
(GuiGraphics pGuiGraphics, int pX, int pY) protected void
renderItem
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) protected void
renderListBackground
(GuiGraphics pGuiGraphics) protected void
renderListItems
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected void
renderListSeparators
(GuiGraphics pGuiGraphics) protected void
renderSelection
(GuiGraphics pGuiGraphics, int pTop, int pWidth, int pHeight, int pOuterColor, int pInnerColor) void
renderWidget
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) void
replaceEntries
(Collection<E> pEntries) private void
scroll
(int pScroll) protected int
protected double
void
setFocused
(GuiEventListener pFocused) Sets the focus state of the GUI element.void
setSelected
(E pSelected) void
setSelectedIndex
(int pSelected) void
updateSize
(int pWidth, HeaderAndFooterLayout pLayout) void
updateSizeAndPosition
(int pWidth, int pHeight, int pY) Methods inherited from class net.minecraft.client.gui.components.AbstractContainerWidget
isDragging, isFocused, mouseClicked, mouseDragged, mouseReleased, nextFocusPath, setDragging, setFocused
Methods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, setScrollAmount, updateScrolling
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, isActive, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, onClick, onDrag, playButtonClickSound, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, visitWidgets, wrapDefaultNarrationMessage
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.ContainerEventHandler
charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getRectangle, isMouseOver, mouseMoved
Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClick
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
MENU_LIST_BACKGROUND
-
INWORLD_MENU_LIST_BACKGROUND
-
minecraft
-
itemHeight
protected final int itemHeight -
children
-
centerListVertically
protected boolean centerListVertically -
renderHeader
private boolean renderHeader -
headerHeight
protected int headerHeight -
selected
-
hovered
-
-
Constructor Details
-
Method Details
-
getSelected
-
setSelectedIndex
public void setSelectedIndex(int pSelected) -
setSelected
-
getFirstElement
-
getFocused
- Specified by:
getFocused
in interfaceContainerEventHandler
- Overrides:
getFocused
in classAbstractContainerWidget
-
children
-
clearEntries
protected void clearEntries() -
replaceEntries
-
getEntry
-
addEntry
-
addEntryToTop
-
removeEntryFromTop
-
getItemCount
protected int getItemCount() -
isSelectedItem
protected boolean isSelectedItem(int pIndex) -
getEntryAtPosition
-
updateSizeAndPosition
public void updateSizeAndPosition(int pWidth, int pHeight, int pY) -
contentHeight
protected int contentHeight()- Specified by:
contentHeight
in classAbstractScrollArea
-
renderHeader
-
renderDecorations
-
renderWidget
- Specified by:
renderWidget
in classAbstractWidget
-
renderListSeparators
-
renderListBackground
-
enableScissor
-
centerScrollOn
-
ensureVisible
-
scroll
private void scroll(int pScroll) -
scrollRate
protected double scrollRate()- Specified by:
scrollRate
in classAbstractScrollArea
-
scrollBarX
protected int scrollBarX()- Overrides:
scrollBarX
in classAbstractScrollArea
-
getChildAt
Returns the first event listener that intersects with the mouse coordinates. -
setFocused
Sets the focus state of the GUI element.- Specified by:
setFocused
in interfaceContainerEventHandler
- Overrides:
setFocused
in classAbstractContainerWidget
- Parameters:
pFocused
- the focused GUI element.
-
renderListItems
protected void renderListItems(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) -
renderItem
protected void renderItem(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) -
renderSelection
protected void renderSelection(GuiGraphics pGuiGraphics, int pTop, int pWidth, int pHeight, int pOuterColor, int pInnerColor) -
getRowLeft
public int getRowLeft() -
getRowRight
public int getRowRight() -
getRowTop
public int getRowTop(int pIndex) -
getRowBottom
public int getRowBottom(int pIndex) -
getRowWidth
public int getRowWidth() -
narrationPriority
- Specified by:
narrationPriority
in interfaceNarratableEntry
- Overrides:
narrationPriority
in classAbstractWidget
-
remove
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-