java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
com.pixelmonmod.pixelmon.client.gui.widgets.SlotBase
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
Direct Known Subclasses:
ClauseListScreen, MoveListScreen, PokemonListScreen, TrainerDropListSlotScreen, TutorListScreen

public abstract class SlotBase extends net.minecraft.client.gui.components.AbstractWidget
  • 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
    int
     
    final int
     
    protected static Color
     
    protected static Color
     
    protected static Color
     
    protected static final int
     
    final int
     
    protected float
     
    protected long
     
    final int
     
    protected boolean
     
    final int
     
    protected float
     
    int
     
    protected int
     
    final int
     
    final int
     

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

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

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

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlotBase(int top, int left, int width, int height, boolean opaque)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
    drawBackground(net.minecraft.client.gui.GuiGraphics graphics)
    Optionally draws a background behind the list.
    protected abstract void
    drawSlot(net.minecraft.client.gui.GuiGraphics graphics, int index, int x, int yTop, int yMiddle)
     
    protected abstract void
    elementClicked(int index, boolean doubleClicked)
     
    protected abstract float[]
     
    protected int[]
     
    int
     
    int
    Gets the x coordinate of the center of the list.
    protected int
     
    int
    getCurrentSlot(int par1, int par2)
     
    int
     
    int
    getMouseOverIndex(int mouseX, int mouseY)
    Gets the index of the element that the cursor is currently over.
    protected Color
     
    protected abstract int
     
    int
     
    boolean
     
    boolean
    isMouseOver(double x, double y)
     
    boolean
    isMouseOver(int element, int par1, int par2)
     
    protected abstract boolean
    isSelected(int element)
     
    boolean
    mouseClicked(double mousePosX, double mousePosY, int button)
     
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
     
    void
    mouseScrolled(int mousePosX, int mousePosY, double delta)
     
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics graphics, int mousePosX, int mousePosY, float partialTicks)
     
    void
    scrollTo(int i)
     

    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, isValidClickButton, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, 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

    charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved

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

    setPosition
  • Field Details

    • COLOUR_BAR_ONE

      protected static Color COLOUR_BAR_ONE
    • COLOUR_BAR_TWO

      protected static Color COLOUR_BAR_TWO
    • COLOUR_BAR_THREE

      protected static Color COLOUR_BAR_THREE
    • DEFAULT_SLOT_HEIGHT

      protected static final int DEFAULT_SLOT_HEIGHT
      See Also:
    • width

      public final int width
    • height

      public final int height
    • top

      public final int top
    • bottom

      public final int bottom
    • left

      public final int left
    • amountScrolled

      public int amountScrolled
    • selectedElement

      public int selectedElement
    • slotHeight

      protected int slotHeight
    • initialClickY

      protected float initialClickY
    • scrollMultiplier

      protected float scrollMultiplier
    • lastClicked

      protected long lastClicked
    • opaque

      protected boolean opaque
  • Constructor Details

    • SlotBase

      public SlotBase(int top, int left, int width, int height, boolean opaque)
  • Method Details

    • getSize

      protected abstract int getSize()
    • elementClicked

      protected abstract void elementClicked(int index, boolean doubleClicked)
    • isSelected

      protected abstract boolean isSelected(int element)
    • getContentHeight

      protected int getContentHeight()
    • drawSlot

      protected abstract void drawSlot(net.minecraft.client.gui.GuiGraphics graphics, int index, int x, int yTop, int yMiddle)
    • get1Color

      protected abstract float[] get1Color()
    • getSelectionColor

      protected Color getSelectionColor()
    • get255Color

      protected int[] get255Color()
    • getCurrentSlot

      public int getCurrentSlot(int par1, int par2)
    • isMouseOver

      public boolean isMouseOver(int element, int par1, int par2)
    • isElementVisible

      public boolean isElementVisible(int i)
    • getTopIndex

      public int getTopIndex()
    • getBottomIndex

      public int getBottomIndex()
    • getElementPosition

      public int getElementPosition(int i)
    • scrollTo

      public void scrollTo(int i)
    • bindAmountScrolled

      public void bindAmountScrolled()
    • isMouseOver

      public boolean isMouseOver(double x, double y)
      Specified by:
      isMouseOver in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      isMouseOver in class net.minecraft.client.gui.components.AbstractWidget
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
    • mouseDragged

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

      public boolean mouseClicked(double mousePosX, double mousePosY, int button)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class net.minecraft.client.gui.components.AbstractWidget
    • renderWidget

      public void renderWidget(net.minecraft.client.gui.GuiGraphics graphics, int mousePosX, int mousePosY, float partialTicks)
      Specified by:
      renderWidget in class net.minecraft.client.gui.components.AbstractWidget
    • mouseScrolled

      public void mouseScrolled(int mousePosX, int mousePosY, double delta)
    • drawBackground

      protected void drawBackground(net.minecraft.client.gui.GuiGraphics graphics)
      Optionally draws a background behind the list.
    • getMouseOverIndex

      public int getMouseOverIndex(int mouseX, int mouseY)
      Gets the index of the element that the cursor is currently over.
      Parameters:
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      Returns:
      The index of the element that the cursor is currently over, or -1 if the cursor is not over the list.
    • getCenterX

      public int getCenterX()
      Gets the x coordinate of the center of the list.
      Returns:
      The x coordinate of the center of the list.