Class AbstractSelectionList<E extends AbstractSelectionList.Entry<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
  • Field Details

    • SCROLLBAR_WIDTH

      protected static final int SCROLLBAR_WIDTH
      See Also:
    • SCROLLER_SPRITE

      private static final ResourceLocation SCROLLER_SPRITE
    • SCROLLER_BACKGROUND_SPRITE

      private static final ResourceLocation SCROLLER_BACKGROUND_SPRITE
    • INWORLD_MENU_LIST_BACKGROUND

      private static final ResourceLocation INWORLD_MENU_LIST_BACKGROUND
    • minecraft

      protected final Minecraft minecraft
    • itemHeight

      protected final int itemHeight
    • children

      private final List<E extends AbstractSelectionList.Entry<E>> children
    • centerListVertically

      protected boolean centerListVertically
    • scrollAmount

      private double scrollAmount
    • renderHeader

      private boolean renderHeader
    • headerHeight

      protected int headerHeight
    • scrolling

      private boolean scrolling
    • selected

      @Nullable private E extends AbstractSelectionList.Entry<E> selected
    • hovered

      @Nullable private E extends AbstractSelectionList.Entry<E> hovered
  • Constructor Details

    • AbstractSelectionList

      public AbstractSelectionList(Minecraft p_93404_, int p_93405_, int p_93406_, int p_93407_, int p_93408_)
  • Method Details

    • setRenderHeader

      protected void setRenderHeader(boolean p_93474_, int p_93475_)
    • getRowWidth

      public int getRowWidth()
    • getSelected

      @Nullable public E getSelected()
    • setSelected

      public void setSelected(@Nullable E p_93462_)
    • getFirstElement

      public E getFirstElement()
    • getFocused

      @Nullable public E getFocused()
      Specified by:
      getFocused in interface ContainerEventHandler
      Overrides:
      getFocused in class AbstractContainerWidget
    • children

      public final List<E> children()
    • clearEntries

      protected void clearEntries()
    • replaceEntries

      protected void replaceEntries(Collection<E> p_93470_)
    • getEntry

      protected E getEntry(int p_93501_)
    • addEntry

      protected int addEntry(E p_93487_)
    • addEntryToTop

      protected void addEntryToTop(E p_239858_)
    • removeEntryFromTop

      protected boolean removeEntryFromTop(E p_239046_)
    • getItemCount

      protected int getItemCount()
    • isSelectedItem

      protected boolean isSelectedItem(int p_93504_)
    • getEntryAtPosition

      @Nullable protected final E getEntryAtPosition(double p_93413_, double p_93414_)
    • updateSize

      public void updateSize(int p_331980_, HeaderAndFooterLayout p_331821_)
    • updateSizeAndPosition

      public void updateSizeAndPosition(int p_332028_, int p_330750_, int p_331681_)
    • getMaxPosition

      protected int getMaxPosition()
    • clickedHeader

      protected boolean clickedHeader(int p_93431_, int p_93432_)
    • renderHeader

      protected void renderHeader(GuiGraphics p_282337_, int p_93444_, int p_93445_)
    • renderDecorations

      protected void renderDecorations(GuiGraphics p_281477_, int p_93459_, int p_93460_)
    • renderWidget

      public void renderWidget(GuiGraphics p_282708_, int p_283242_, int p_282891_, float p_283683_)
      Specified by:
      renderWidget in class AbstractWidget
    • scrollbarVisible

      protected boolean scrollbarVisible()
    • renderListSeparators

      protected void renderListSeparators(GuiGraphics p_331248_)
    • renderListBackground

      protected void renderListBackground(GuiGraphics p_331297_)
    • enableScissor

      protected void enableScissor(GuiGraphics p_282811_)
    • centerScrollOn

      protected void centerScrollOn(E p_93495_)
    • ensureVisible

      protected void ensureVisible(E p_93499_)
    • scroll

      private void scroll(int p_93430_)
    • getScrollAmount

      public double getScrollAmount()
    • setClampedScrollAmount

      public void setClampedScrollAmount(double p_345538_)
    • setScrollAmount

      public void setScrollAmount(double p_93411_)
    • clampScrollAmount

      public void clampScrollAmount()
    • getMaxScroll

      public int getMaxScroll()
    • updateScrollingState

      protected void updateScrollingState(double p_93482_, double p_93483_, int p_93484_)
    • getScrollbarPosition

      protected int getScrollbarPosition()
    • getDefaultScrollbarPosition

      protected int getDefaultScrollbarPosition()
    • getListOutlinePadding

      private int getListOutlinePadding()
    • isValidMouseClick

      protected boolean isValidMouseClick(int p_301202_)
    • mouseClicked

      public boolean mouseClicked(double p_93420_, double p_93421_, int p_93422_)
      Specified by:
      mouseClicked in interface ContainerEventHandler
      Specified by:
      mouseClicked in interface GuiEventListener
      Overrides:
      mouseClicked in class AbstractContainerWidget
    • mouseReleased

      public boolean mouseReleased(double p_93491_, double p_93492_, int p_93493_)
      Specified by:
      mouseReleased in interface ContainerEventHandler
      Specified by:
      mouseReleased in interface GuiEventListener
      Overrides:
      mouseReleased in class AbstractContainerWidget
    • mouseDragged

      public boolean mouseDragged(double p_93424_, double p_93425_, int p_93426_, double p_93427_, double p_93428_)
      Specified by:
      mouseDragged in interface ContainerEventHandler
      Specified by:
      mouseDragged in interface GuiEventListener
      Overrides:
      mouseDragged in class AbstractContainerWidget
    • mouseScrolled

      public boolean mouseScrolled(double p_93416_, double p_93417_, double p_93418_, double p_294369_)
    • setFocused

      public void setFocused(@Nullable GuiEventListener p_265738_)
      Specified by:
      setFocused in interface ContainerEventHandler
      Overrides:
      setFocused in class AbstractContainerWidget
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection p_265160_)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection p_265210_, Predicate<E> p_265604_)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection p_265159_, Predicate<E> p_265109_, @Nullable E p_265379_)
    • isMouseOver

      public boolean isMouseOver(double p_93479_, double p_93480_)
      Specified by:
      isMouseOver in interface GuiEventListener
      Overrides:
      isMouseOver in class AbstractWidget
    • renderListItems

      protected void renderListItems(GuiGraphics p_282079_, int p_239229_, int p_239230_, float p_239231_)
    • renderItem

      protected void renderItem(GuiGraphics p_282205_, int p_238966_, int p_238967_, float p_238968_, int p_238969_, int p_238970_, int p_238971_, int p_238972_, int p_238973_)
    • renderSelection

      protected void renderSelection(GuiGraphics p_283589_, int p_240142_, int p_240143_, int p_240144_, int p_240145_, int p_240146_)
    • getRowLeft

      public int getRowLeft()
    • getRealRowLeft

      private int getRealRowLeft()
    • getRowRight

      public int getRowRight()
    • getRealRowRight

      private int getRealRowRight()
    • getRowTop

      protected int getRowTop(int p_93512_)
    • getRowBottom

      protected int getRowBottom(int p_93486_)
    • narrationPriority

      public NarratableEntry.NarrationPriority narrationPriority()
      Specified by:
      narrationPriority in interface NarratableEntry
      Overrides:
      narrationPriority in class AbstractWidget
    • remove

      @Nullable protected E remove(int p_93515_)
    • removeEntry

      protected boolean removeEntry(E p_93503_)
    • getHovered

      @Nullable protected E getHovered()
    • bindEntryToSelf

      void bindEntryToSelf(AbstractSelectionList.Entry<E> p_93506_)
    • narrateListElementPosition

      protected void narrateListElementPosition(NarrationElementOutput p_168791_, E p_168792_)