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 minecraft, int width, int height, int y, int itemHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intprotected voidaddEntryToTop(E entry) protected voidaddEntryToTop(E entry, int height) (package private) voidprotected voidcenterScrollOn(E entry) children()voidprotected voidclearEntriesExcept(E entry) protected intprotected voidenableScissor(GuiGraphics guiGraphics) protected booleangetChildAt(double p_386910_, double p_387686_) Returns the first event listener that intersects with the mouse coordinates.protected final EgetEntryAtPosition(double mouseX, double mouseY) private intprotected Eprotected intintgetNextY()intgetRowBottom(int index) intintintgetRowTop(int index) intprotected 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 voidremoveEntries(List<E> entries) protected voidremoveEntry(E entry) protected voidremoveEntryFromTop(E entry) protected voidrenderItem(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick, E item) protected voidrenderListBackground(GuiGraphics guiGraphics) protected voidrenderListItems(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected voidrenderListSeparators(GuiGraphics guiGraphics) protected voidrenderSelection(GuiGraphics guiGraphics, E entry, int backgroundColor) voidrenderWidget(GuiGraphics p_282708_, int p_283242_, int p_282891_, float p_283683_) voidreplaceEntries(Collection<E> entries) private voidprivate voidscroll(int scroll) protected intprotected doubleprotected voidscrollToEntry(E entry) 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 selected) protected voidsort(Comparator<E> comparator) protected voidswap(int index1, int index2) voidupdateSize(int width, HeaderAndFooterLayout layout) voidupdateSizeAndPosition(int width, int height, int y) voidupdateSizeAndPosition(int width, int height, int x, int y) 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
-
-
Method Details
-
getSelected
-
setSelected
-
getFocused
- Specified by:
getFocusedin interfaceContainerEventHandler- Overrides:
getFocusedin classAbstractContainerWidget
-
children
-
sort
-
swap
protected void swap(int index1, int index2) -
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 width, int height, int y) -
updateSizeAndPosition
public void updateSizeAndPosition(int width, int height, int x, int y) -
contentHeight
protected int contentHeight()- Specified by:
contentHeightin classAbstractScrollArea
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
renderListSeparators
-
renderListBackground
-
enableScissor
-
scrollToEntry
-
centerScrollOn
-
scroll
private void scroll(int scroll) -
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
-
renderItem
protected void renderItem(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick, E item) -
renderSelection
-
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
-
removeEntries
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-