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 minecraft, int width, int height, int y, int itemHeight) AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight, int headerHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected voidaddEntryToTop(E entry) (package private) voidprotected voidcenterScrollOn(E entry) children()protected voidprotected intprotected voidenableScissor(GuiGraphics guiGraphics) protected voidensureVisible(E entry) getChildAt(double p_386910_, double p_387686_) Returns the first event listener that intersects with the mouse coordinates.protected EgetEntry(int index) protected final EgetEntryAtPosition(double mouseX, double mouseY) protected Eprotected intintgetRowBottom(int index) intintintgetRowTop(int index) intprotected booleanisSelectedItem(int index) protected voidnarrateListElementPosition(NarrationElementOutput narrationElementOutput, E entry) protected EnextEntry(ScreenDirection direction) protected EnextEntry(ScreenDirection direction, Predicate<E> predicate) protected EnextEntry(ScreenDirection direction, Predicate<E> predicate, E selected) protected Eremove(int index) protected booleanremoveEntry(E entry) protected booleanremoveEntryFromTop(E entry) protected voidrenderDecorations(GuiGraphics guiGraphics, int mouseX, int mouseY) protected voidrenderHeader(GuiGraphics guiGraphics, int x, int y) protected voidrenderItem(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick, int index, int left, int top, int width, int height) protected voidrenderListBackground(GuiGraphics guiGraphics) protected voidrenderListItems(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected voidrenderListSeparators(GuiGraphics guiGraphics) protected voidrenderSelection(GuiGraphics guiGraphics, int top, int width, int height, int outerColor, int innerColor) voidrenderWidget(GuiGraphics p_282708_, int p_283242_, int p_282891_, float p_283683_) voidreplaceEntries(Collection<E> entries) private voidscroll(int scroll) protected intprotected doublevoidsetFocused(GuiEventListener p_265738_) Sets the focus state of the GUI element.voidsetSelected(E selected) voidsetSelectedIndex(int selected) voidupdateSize(int width, HeaderAndFooterLayout layout) voidupdateSizeAndPosition(int width, int height, int y) 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, getTooltip, 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
-
AbstractSelectionList
-
AbstractSelectionList
public AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight, int headerHeight)
-
-
Method Details
-
getSelected
-
setSelectedIndex
public void setSelectedIndex(int selected) -
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 index) -
getEntryAtPosition
-
updateSizeAndPosition
public void updateSizeAndPosition(int width, int height, int y) -
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 scroll) -
scrollRate
protected double scrollRate()- Specified by:
scrollRatein classAbstractScrollArea
-
scrollBarX
protected int scrollBarX()- Overrides:
scrollBarXin classAbstractScrollArea
-
getChildAt
Description copied from interface:ContainerEventHandlerReturns the first event listener that intersects with the mouse coordinates. -
setFocused
Description copied from interface:ContainerEventHandlerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Overrides:
setFocusedin classAbstractContainerWidget- Parameters:
p_265738_- the focused GUI element.
-
renderListItems
-
renderItem
protected void renderItem(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick, int index, int left, int top, int width, int height) -
renderSelection
protected void renderSelection(GuiGraphics guiGraphics, int top, int width, int height, int outerColor, int innerColor) -
getRowLeft
public int getRowLeft() -
getRowRight
public int getRowRight() -
getRowTop
public int getRowTop(int index) -
getRowBottom
public int getRowBottom(int index) -
getRowWidth
public int getRowWidth() -
narrationPriority
- Specified by:
narrationPriorityin interfaceNarratableEntry- Overrides:
narrationPriorityin classAbstractWidget
-
remove
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-