Class SliderWidget

All Implemented Interfaces:
Drawable, Element, Narratable, Selectable
Direct Known Subclasses:
OptionSliderWidget, RealmsSlotOptionsScreen.SettingsSlider

@Environment(CLIENT) public abstract class SliderWidget extends ClickableWidget
Mappings:
Namespace Name
official ego
intermediary net/minecraft/class_357
named net/minecraft/client/gui/widget/SliderWidget
  • Field Details

    • value

      protected double value
      Mappings:
      Namespace Name Mixin selector
      official b Lego;b:D
      intermediary field_22753 Lnet/minecraft/class_357;field_22753:D
      named value Lnet/minecraft/client/gui/widget/SliderWidget;value:D
  • Constructor Details

    • SliderWidget

      public SliderWidget(int x, int y, int width, int height, Text text, double value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lego;<init>(IIIILrm;D)V
      intermediary <init> Lnet/minecraft/class_357;<init>(IIIILnet/minecraft/class_2561;D)V
      named <init> Lnet/minecraft/client/gui/widget/SliderWidget;<init>(IIIILnet/minecraft/text/Text;D)V
  • Method Details

    • getYImage

      protected int getYImage(boolean hovered)
      Overrides:
      getYImage in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(Z)I
      intermediary method_25356 Lnet/minecraft/class_339;method_25356(Z)I
      named getYImage Lnet/minecraft/client/gui/widget/ClickableWidget;getYImage(Z)I
    • getNarrationMessage

      protected MutableText getNarrationMessage()
      Overrides:
      getNarrationMessage in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official ak_ Legp;ak_()Lrt;
      intermediary method_25360 Lnet/minecraft/class_339;method_25360()Lnet/minecraft/class_5250;
      named getNarrationMessage Lnet/minecraft/client/gui/widget/ClickableWidget;getNarrationMessage()Lnet/minecraft/text/MutableText;
    • appendNarrations

      public void appendNarrations(NarrationMessageBuilder builder)
      Mappings:
      Namespace Name Mixin selector
      official a Leiu;a(Leit;)V
      intermediary method_37020 Lnet/minecraft/class_6383;method_37020(Lnet/minecraft/class_6382;)V
      named appendNarrations Lnet/minecraft/client/gui/Narratable;appendNarrations(Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;)V
    • renderBackground

      protected void renderBackground(MatrixStack matrices, MinecraftClient client, int mouseX, int mouseY)
      Overrides:
      renderBackground in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(Ldzs;Leeu;II)V
      intermediary method_25353 Lnet/minecraft/class_339;method_25353(Lnet/minecraft/class_4587;Lnet/minecraft/class_310;II)V
      named renderBackground Lnet/minecraft/client/gui/widget/ClickableWidget;renderBackground(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/MinecraftClient;II)V
    • onClick

      public void onClick(double mouseX, double mouseY)
      Overrides:
      onClick in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(DD)V
      intermediary method_25348 Lnet/minecraft/class_339;method_25348(DD)V
      named onClick Lnet/minecraft/client/gui/widget/ClickableWidget;onClick(DD)V
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Callback for when a key down event has been captured. The key code is identified by the constants in GLFW class.
      Parameters:
      keyCode - the named key code of the event as described in the GLFW class
      scanCode - the unique/platform-specific scan code of the keyboard input
      modifiers - a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lehp;a(III)Z
      intermediary method_25404 Lnet/minecraft/class_364;method_25404(III)Z
      named keyPressed Lnet/minecraft/client/gui/Element;keyPressed(III)Z
    • setValueFromMouse

      private void setValueFromMouse(double mouseX)
      Sets the value from mouse position.

      The value will be calculated from the position and the width of this slider.

      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lego;a(D)V
      intermediary method_25345 Lnet/minecraft/class_357;method_25345(D)V
      named setValueFromMouse Lnet/minecraft/client/gui/widget/SliderWidget;setValueFromMouse(D)V
    • setValue

      private void setValue(double value)
      Parameters:
      value - the new value; will be clamped to [0, 1]
      Mappings:
      Namespace Name Mixin selector
      official b Lego;b(D)V
      intermediary method_25347 Lnet/minecraft/class_357;method_25347(D)V
      named setValue Lnet/minecraft/client/gui/widget/SliderWidget;setValue(D)V
    • onDrag

      protected void onDrag(double mouseX, double mouseY, double deltaX, double deltaY)
      Overrides:
      onDrag in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(DDDD)V
      intermediary method_25349 Lnet/minecraft/class_339;method_25349(DDDD)V
      named onDrag Lnet/minecraft/client/gui/widget/ClickableWidget;onDrag(DDDD)V
    • playDownSound

      public void playDownSound(SoundManager soundManager)
      Overrides:
      playDownSound in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(Lfma;)V
      intermediary method_25354 Lnet/minecraft/class_339;method_25354(Lnet/minecraft/class_1144;)V
      named playDownSound Lnet/minecraft/client/gui/widget/ClickableWidget;playDownSound(Lnet/minecraft/client/sound/SoundManager;)V
    • onRelease

      public void onRelease(double mouseX, double mouseY)
      Overrides:
      onRelease in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official b Legp;b(DD)V
      intermediary method_25357 Lnet/minecraft/class_339;method_25357(DD)V
      named onRelease Lnet/minecraft/client/gui/widget/ClickableWidget;onRelease(DD)V
    • updateMessage

      protected abstract void updateMessage()
      Mappings:
      Namespace Name Mixin selector
      official b Lego;b()V
      intermediary method_25346 Lnet/minecraft/class_357;method_25346()V
      named updateMessage Lnet/minecraft/client/gui/widget/SliderWidget;updateMessage()V
    • applyValue

      protected abstract void applyValue()
      Mappings:
      Namespace Name Mixin selector
      official a Lego;a()V
      intermediary method_25344 Lnet/minecraft/class_357;method_25344()V
      named applyValue Lnet/minecraft/client/gui/widget/SliderWidget;applyValue()V