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) classNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprivate Eprivate static final ResourceLocationprotected final intprivate static final ResourceLocationprotected final Minecraftprivate booleanprivate EFields inherited from class net.minecraft.client.gui.components.AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, widthFields 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 intprotected voidaddEntryToTop(E pEntry) (package private) voidbindEntryToSelf(AbstractSelectionList.Entry<E> pEntry) protected voidcenterScrollOn(E pEntry) children()protected voidprotected intprotected voidenableScissor(GuiGraphics pGuiGraphics) protected voidensureVisible(E pEntry) getChildAt(double pMouseX, double pMouseY) Returns the first event listener that intersects with the mouse coordinates.protected EgetEntry(int pIndex) protected final EgetEntryAtPosition(double pMouseX, double pMouseY) protected Eprotected intintgetRowBottom(int pIndex) intintintgetRowTop(int pIndex) intprotected booleanisSelectedItem(int pIndex) protected voidnarrateListElementPosition(NarrationElementOutput pNarrationElementOutput, E pEntry) protected EnextEntry(ScreenDirection pDirection) protected EnextEntry(ScreenDirection pDirection, Predicate<E> pPredicate) protected EnextEntry(ScreenDirection pDirection, Predicate<E> pPredicate, E pSelected) protected Eremove(int pIndex) protected booleanremoveEntry(E pEntry) protected booleanremoveEntryFromTop(E pEntry) protected voidrenderDecorations(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY) protected voidrenderHeader(GuiGraphics pGuiGraphics, int pX, int pY) protected voidrenderItem(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) protected voidrenderListBackground(GuiGraphics pGuiGraphics) protected voidrenderListItems(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected voidrenderListSeparators(GuiGraphics pGuiGraphics) protected voidrenderSelection(GuiGraphics pGuiGraphics, int pTop, int pWidth, int pHeight, int pOuterColor, int pInnerColor) voidrenderWidget(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) voidreplaceEntries(Collection<E> pEntries) private voidscroll(int pScroll) protected intprotected doublevoidsetFocused(GuiEventListener pFocused) Sets the focus state of the GUI element.voidsetSelected(E pSelected) voidsetSelectedIndex(int pSelected) voidupdateSize(int pWidth, HeaderAndFooterLayout pLayout) voidupdateSizeAndPosition(int pWidth, int pHeight, int pY) Methods inherited from class net.minecraft.client.gui.components.AbstractContainerWidget
isDragging, isFocused, mouseClicked, mouseDragged, mouseReleased, nextFocusPath, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, setScrollAmount, updateScrollingMethods 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, wrapDefaultNarrationMessageMethods 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, getCurrentFocusPath, keyPressed, keyReleased, mouseScrolledMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getRectangle, isMouseOver, mouseMovedMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratablesMethods 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:
getFocusedin interfaceContainerEventHandler- Overrides:
getFocusedin 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:
contentHeightin classAbstractScrollArea
-
renderHeader
-
renderDecorations
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
renderListSeparators
-
renderListBackground
-
enableScissor
-
centerScrollOn
-
ensureVisible
-
scroll
private void scroll(int pScroll) -
scrollRate
protected double scrollRate()- Specified by:
scrollRatein classAbstractScrollArea
-
scrollBarX
protected int scrollBarX()- Overrides:
scrollBarXin classAbstractScrollArea
-
getChildAt
Returns the first event listener that intersects with the mouse coordinates. -
setFocused
Sets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Overrides:
setFocusedin 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:
narrationPriorityin interfaceNarratableEntry- Overrides:
narrationPriorityin classAbstractWidget
-
remove
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-