Class Slider

All Implemented Interfaces:
GuiEventListener, Widget, NarratableEntry, NarrationSupplier

@Deprecated(since="1.18.2", forRemoval=true) public class Slider extends ExtendedButton
Deprecated, for removal: This API element is subject to removal in a future version.
This class has a few issues, mainly MinecraftForge/MinecraftForge#8485. Use ForgeSlider instead.
This class is blatantly stolen from iChunUtils with permission.
Author:
iChun
  • Field Details

    • sliderValue

      public double sliderValue
      Deprecated, for removal: This API element is subject to removal in a future version.
      The value of this slider control.
    • dispString

      public Component dispString
      Deprecated, for removal: This API element is subject to removal in a future version.
    • dragging

      public boolean dragging
      Deprecated, for removal: This API element is subject to removal in a future version.
      Is this slider control being dragged.
    • showDecimal

      public boolean showDecimal
      Deprecated, for removal: This API element is subject to removal in a future version.
    • minValue

      public double minValue
      Deprecated, for removal: This API element is subject to removal in a future version.
    • maxValue

      public double maxValue
      Deprecated, for removal: This API element is subject to removal in a future version.
    • precision

      public int precision
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parent

      @Nullable public Slider.ISlider parent
      Deprecated, for removal: This API element is subject to removal in a future version.
    • suffix

      public Component suffix
      Deprecated, for removal: This API element is subject to removal in a future version.
    • drawString

      public boolean drawString
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • Slider

      public Slider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Slider

      public Slider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler, @Nullable Slider.ISlider par)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Slider

      public Slider(int xPos, int yPos, Component displayStr, double minVal, double maxVal, double currentVal, Button.OnPress handler, Slider.ISlider par)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getYImage

      public int getYImage(boolean par1)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
      Overrides:
      getYImage in class AbstractWidget
    • renderBg

      protected void renderBg(PoseStack poseStack, Minecraft minecraft, int par2, int par3)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
      Overrides:
      renderBg in class AbstractWidget
    • onClick

      public void onClick(double mouseX, double mouseY)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
      Overrides:
      onClick in class AbstractButton
    • updateSlider

      public void updateSlider()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onRelease

      public void onRelease(double mouseX, double mouseY)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).
      Overrides:
      onRelease in class AbstractWidget
    • getValueInt

      public int getValueInt()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getValue

      public double getValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setValue

      public void setValue(double d)
      Deprecated, for removal: This API element is subject to removal in a future version.