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

  • Constructor Details

    • AbstractSelectionList

      public AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight)
    • AbstractSelectionList

      public AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight, int headerHeight)
  • Method Details

    • getSelected

      @Nullable public E getSelected()
    • setSelectedIndex

      public void setSelectedIndex(int selected)
    • setSelected

      public void setSelected(@Nullable E selected)
    • 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

      public void replaceEntries(Collection<E> entries)
    • getEntry

      protected E getEntry(int index)
    • addEntry

      protected int addEntry(E entry)
    • addEntryToTop

      protected void addEntryToTop(E entry)
    • removeEntryFromTop

      protected boolean removeEntryFromTop(E entry)
    • getItemCount

      protected int getItemCount()
    • isSelectedItem

      protected boolean isSelectedItem(int index)
    • getEntryAtPosition

      @Nullable protected final E getEntryAtPosition(double mouseX, double mouseY)
    • updateSize

      public void updateSize(int width, HeaderAndFooterLayout layout)
    • updateSizeAndPosition

      public void updateSizeAndPosition(int width, int height, int y)
    • contentHeight

      protected int contentHeight()
      Specified by:
      contentHeight in class AbstractScrollArea
    • renderHeader

      protected void renderHeader(GuiGraphics guiGraphics, int x, int y)
    • renderDecorations

      protected void renderDecorations(GuiGraphics guiGraphics, int mouseX, int mouseY)
    • renderWidget

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

      protected void renderListSeparators(GuiGraphics guiGraphics)
    • renderListBackground

      protected void renderListBackground(GuiGraphics guiGraphics)
    • enableScissor

      protected void enableScissor(GuiGraphics guiGraphics)
    • centerScrollOn

      protected void centerScrollOn(E entry)
    • ensureVisible

      protected void ensureVisible(E entry)
    • scroll

      private void scroll(int scroll)
    • scrollRate

      protected double scrollRate()
      Specified by:
      scrollRate in class AbstractScrollArea
    • scrollBarX

      protected int scrollBarX()
      Overrides:
      scrollBarX in class AbstractScrollArea
    • getChildAt

      public Optional<GuiEventListener> getChildAt(double p_386910_, double p_387686_)
      Description copied from interface: ContainerEventHandler
      Returns the first event listener that intersects with the mouse coordinates.
    • setFocused

      public void setFocused(@Nullable GuiEventListener p_265738_)
      Description copied from interface: ContainerEventHandler
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface ContainerEventHandler
      Overrides:
      setFocused in class AbstractContainerWidget
      Parameters:
      p_265738_ - the focused GUI element.
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection direction)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection direction, Predicate<E> predicate)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection direction, Predicate<E> predicate, @Nullable E selected)
    • renderListItems

      protected void renderListItems(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
    • 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

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

      @Nullable protected E remove(int index)
    • removeEntry

      protected boolean removeEntry(E entry)
    • getHovered

      @Nullable protected E getHovered()
    • bindEntryToSelf

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

      protected void narrateListElementPosition(NarrationElementOutput narrationElementOutput, E entry)