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

  • Constructor Details

    • AbstractSelectionList

      public AbstractSelectionList(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight)
  • Method Details

    • getSelected

      @Nullable public E getSelected()
    • setSelected

      public void setSelected(@Nullable E pSelected)
    • getFocused

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

      public final List<E> children()
    • sort

      protected void sort(Comparator<E> pComparator)
    • swap

      protected void swap(int pIndex1, int pIndex2)
    • clearEntries

      public void clearEntries()
    • clearEntriesExcept

      protected void clearEntriesExcept(E pEntry)
    • replaceEntries

      public void replaceEntries(Collection<E> pEntries)
    • getFirstEntryY

      private int getFirstEntryY()
    • getNextY

      public int getNextY()
    • addEntry

      protected int addEntry(E pEntry)
    • addEntry

      protected int addEntry(E pEntry, int pIndex)
    • addEntryToTop

      protected void addEntryToTop(E pEntry)
    • addEntryToTop

      protected void addEntryToTop(E pEntry, int pHeight)
    • repositionEntries

      private void repositionEntries()
    • removeEntryFromTop

      protected void removeEntryFromTop(E pEntry)
    • getItemCount

      protected int getItemCount()
    • entriesCanBeSelected

      protected boolean entriesCanBeSelected()
    • getEntryAtPosition

      @Nullable protected final E getEntryAtPosition(double pMouseX, double pMouseY)
    • updateSize

      public void updateSize(int pWidth, HeaderAndFooterLayout pLayout)
    • 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:
      contentHeight in class AbstractScrollArea
    • 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 pGuiGraphics)
    • renderListBackground

      protected void renderListBackground(GuiGraphics pGuiGraphics)
    • enableScissor

      protected void enableScissor(GuiGraphics pGuiGraphics)
    • scrollToEntry

      protected void scrollToEntry(E pEntry)
    • centerScrollOn

      protected void centerScrollOn(E pEntry)
    • scroll

      private void scroll(int pScroll)
    • setScrollAmount

      public void setScrollAmount(double p_439419_)
      Overrides:
      setScrollAmount in class AbstractScrollArea
    • 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(boolean p_439058_)
      Description copied from interface: GuiEventListener
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface ContainerEventHandler
      Specified by:
      setFocused in interface GuiEventListener
      Overrides:
      setFocused in class AbstractContainerWidget
      Parameters:
      p_439058_ - true to apply focus, false to remove focus
    • 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 pDirection)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection pDirection, Predicate<E> pPredicate)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection pDirection, Predicate<E> pPredicate, @Nullable E pSelected)
    • 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

      protected void renderSelection(GuiGraphics pGuiGraphics, E pEntry, int pBackgroundColor)
    • 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

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

      protected void removeEntries(List<E> pEntries)
    • removeEntry

      protected void removeEntry(E pEntry)
    • getHovered

      @Nullable protected E getHovered()
    • bindEntryToSelf

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

      protected void narrateListElementPosition(NarrationElementOutput pNarrationElementOutput, E pEntry)