Class ExtendableScrollableListWidget<T extends net.minecraft.client.gui.layouts.LayoutElement & net.minecraft.client.gui.components.Renderable>

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollWidget
com.pixelmonmod.pixelmon.client.gui.npc.widget.ExtendableScrollableListWidget<T>
All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier

public class ExtendableScrollableListWidget<T extends net.minecraft.client.gui.layouts.LayoutElement & net.minecraft.client.gui.components.Renderable> extends net.minecraft.client.gui.components.AbstractScrollWidget
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected net.minecraft.client.gui.components.Button
     
    protected T
     
    protected int
     
    protected List<com.mojang.datafixers.util.Pair<T,SpriteButton>>
     

    Fields inherited from class net.minecraft.client.gui.components.AbstractScrollWidget

    scrollAmount, scrolling

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    active, alpha, focused, height, hoverOrFocusedStartTime, isHovered, message, MIN_SCROLL_PERIOD, packedFGColor, PERIOD_PER_SCROLLED_PIXEL, tabOrderGroup, tooltip, tooltipMsDelay, UNSET_FG_COLOR, visible, wasHoveredOrFocused, width, x, y

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtendableScrollableListWidget(int x, int y, int width, int height, Supplier<T> defaultProvider, Consumer<T> removeFunction)
     
    ExtendableScrollableListWidget(int width, int height, Supplier<T> defaultProvider, Consumer<T> removeFunction)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addWidgets(T... widgets)
     
    boolean
    charTyped(char character, int modifiers)
     
    protected T
    findElementFor(double mouseX, double mouseY)
     
    protected SpriteButton
    findRemoveFor(double mouseX, double mouseY)
     
    protected double
    findYFor(T widget, double mouseY)
     
    protected int
     
    protected boolean
    isOverAddButton(double mouseX, double mouseY)
     
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
     
    boolean
    mouseClicked(double mouseX, double mouseY, int button)
     
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
     
    protected void
    renderBackground(net.minecraft.client.gui.GuiGraphics graphics)
     
    protected void
    renderContents(net.minecraft.client.gui.GuiGraphics gui, int mouseX, int mouseY, float partialTicks)
     
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
     
    protected double
     
    protected void
    setFocussed(T focussed)
     
    void
    setPaddingY(int paddingY)
     
    protected void
    updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput p_259858_)
     

    Methods inherited from class net.minecraft.client.gui.components.AbstractScrollWidget

    getMaxScrollAmount, innerPadding, mouseReleased, renderBorder, renderDecorations, scrollAmount, scrollbarVisible, scrollbarWidth, setScrollAmount, totalInnerPadding, withinContentAreaPoint, withinContentAreaTopBottom

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, clicked, createNarrationMessage, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, nextFocusPath, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    getCurrentFocusPath, getRectangle, isFocused, isMouseOver, keyReleased, mouseMoved, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition

    Methods inherited from interface net.minecraft.client.gui.components.Renderable

    render

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • widgets

      protected List<com.mojang.datafixers.util.Pair<T extends net.minecraft.client.gui.layouts.LayoutElement & net.minecraft.client.gui.components.Renderable,SpriteButton>> widgets
    • paddingY

      protected int paddingY
    • focussed

      protected T extends net.minecraft.client.gui.layouts.LayoutElement & net.minecraft.client.gui.components.Renderable focussed
    • addButton

      protected net.minecraft.client.gui.components.Button addButton
  • Constructor Details

    • ExtendableScrollableListWidget

      public ExtendableScrollableListWidget(int x, int y, int width, int height, Supplier<T> defaultProvider, Consumer<T> removeFunction)
    • ExtendableScrollableListWidget

      public ExtendableScrollableListWidget(int width, int height, Supplier<T> defaultProvider, Consumer<T> removeFunction)
  • Method Details

    • addWidgets

      public void addWidgets(T... widgets)
    • setPaddingY

      public void setPaddingY(int paddingY)
    • getInnerHeight

      protected int getInnerHeight()
      Specified by:
      getInnerHeight in class net.minecraft.client.gui.components.AbstractScrollWidget
    • scrollRate

      protected double scrollRate()
      Specified by:
      scrollRate in class net.minecraft.client.gui.components.AbstractScrollWidget
    • renderWidget

      public void renderWidget(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      renderWidget in class net.minecraft.client.gui.components.AbstractScrollWidget
    • renderContents

      protected void renderContents(net.minecraft.client.gui.GuiGraphics gui, int mouseX, int mouseY, float partialTicks)
      Specified by:
      renderContents in class net.minecraft.client.gui.components.AbstractScrollWidget
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseScrolled in class net.minecraft.client.gui.components.AbstractScrollWidget
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseDragged in class net.minecraft.client.gui.components.AbstractScrollWidget
    • renderBackground

      protected void renderBackground(net.minecraft.client.gui.GuiGraphics graphics)
      Overrides:
      renderBackground in class net.minecraft.client.gui.components.AbstractScrollWidget
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class net.minecraft.client.gui.components.AbstractScrollWidget
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class net.minecraft.client.gui.components.AbstractScrollWidget
    • charTyped

      public boolean charTyped(char character, int modifiers)
    • findElementFor

      protected T findElementFor(double mouseX, double mouseY)
    • findRemoveFor

      protected SpriteButton findRemoveFor(double mouseX, double mouseY)
    • findYFor

      protected double findYFor(T widget, double mouseY)
    • isOverAddButton

      protected boolean isOverAddButton(double mouseX, double mouseY)
    • setFocussed

      protected void setFocussed(T focussed)
    • updateWidgetNarration

      protected void updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput p_259858_)
      Specified by:
      updateWidgetNarration in class net.minecraft.client.gui.components.AbstractWidget