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
- 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 final intprivate Eprivate static final ResourceLocationprivate static final ResourceLocationprotected final Minecraftprivate Eprivate static final intFields 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, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSelectionList(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intprotected voidaddEntryToTop(E pEntry) protected voidaddEntryToTop(E pEntry, int pHeight) (package private) voidbindEntryToSelf(AbstractSelectionList.Entry<E> pEntry) protected voidcenterScrollOn(E pEntry) children()voidprotected voidclearEntriesExcept(E pEntry) protected intprotected voidenableScissor(GuiGraphics pGuiGraphics) protected booleangetChildAt(double p_386910_, double p_387686_) Returns the first event listener that intersects with the mouse coordinates.protected final EgetEntryAtPosition(double pMouseX, double pMouseY) private intprotected Eprotected intintgetNextY()intgetRowBottom(int pIndex) intintintgetRowTop(int pIndex) intprotected 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 voidremoveEntries(List<E> pEntries) protected voidremoveEntry(E pEntry) protected voidremoveEntryFromTop(E pEntry) protected voidrenderItem(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, E pItem) protected voidrenderListBackground(GuiGraphics pGuiGraphics) protected voidrenderListItems(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected voidrenderListSeparators(GuiGraphics pGuiGraphics) protected voidrenderSelection(GuiGraphics pGuiGraphics, E pEntry, int pBackgroundColor) voidrenderWidget(GuiGraphics p_282708_, int p_283242_, int p_282891_, float p_283683_) voidreplaceEntries(Collection<E> pEntries) private voidprivate voidscroll(int pScroll) protected intprotected doubleprotected voidscrollToEntry(E pEntry) voidsetFocused(boolean p_439058_) Sets the focus state of the GUI element.voidsetFocused(GuiEventListener p_265738_) Sets the focus state of the GUI element.voidsetScrollAmount(double p_439419_) voidsetSelected(E pSelected) protected voidsort(Comparator<E> pComparator) protected voidswap(int pIndex1, int pIndex2) voidupdateSize(int pWidth, HeaderAndFooterLayout pLayout) voidupdateSizeAndPosition(int pWidth, int pHeight, int pY) voidupdateSizeAndPosition(int pWidth, int pHeight, int pX, int pY) Methods inherited from class net.minecraft.client.gui.components.AbstractContainerWidget
isDragging, isFocused, mouseClicked, mouseDragged, mouseReleased, nextFocusPath, setDraggingMethods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
isOverScrollbar, maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, 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, mouseMoved, shouldTakeFocusAfterInteractionMethods 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
-
SEPARATOR_HEIGHT
private static final int SEPARATOR_HEIGHT- See Also:
-
minecraft
-
defaultEntryHeight
protected final int defaultEntryHeight -
children
-
centerListVertically
protected boolean centerListVertically -
selected
-
hovered
-
-
Constructor Details
-
AbstractSelectionList
public AbstractSelectionList(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight)
-
-
Method Details
-
getSelected
-
setSelected
-
getFocused
- Specified by:
getFocusedin interfaceContainerEventHandler- Overrides:
getFocusedin classAbstractContainerWidget
-
children
-
sort
-
swap
protected void swap(int pIndex1, int pIndex2) -
clearEntries
public void clearEntries() -
clearEntriesExcept
-
replaceEntries
-
getFirstEntryY
private int getFirstEntryY() -
getNextY
public int getNextY() -
addEntry
-
addEntry
-
addEntryToTop
-
addEntryToTop
-
repositionEntries
private void repositionEntries() -
removeEntryFromTop
-
getItemCount
protected int getItemCount() -
entriesCanBeSelected
protected boolean entriesCanBeSelected() -
getEntryAtPosition
-
updateSizeAndPosition
public void updateSizeAndPosition(int pWidth, int pHeight, int pY) -
updateSizeAndPosition
public void updateSizeAndPosition(int pWidth, int pHeight, int pX, int pY) -
contentHeight
protected int contentHeight()- Specified by:
contentHeightin classAbstractScrollArea
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
renderListSeparators
-
renderListBackground
-
enableScissor
-
scrollToEntry
-
centerScrollOn
-
scroll
private void scroll(int pScroll) -
setScrollAmount
public void setScrollAmount(double p_439419_) - Overrides:
setScrollAmountin classAbstractScrollArea
-
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
public void setFocused(boolean p_439058_) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractContainerWidget- Parameters:
p_439058_-trueto apply focus,falseto remove focus
-
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
protected void renderListItems(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) -
renderItem
protected void renderItem(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, E pItem) -
renderSelection
-
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
-
removeEntries
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-