Package net.minecraft.client.gui.widget
Class CyclingButtonWidget<T>
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.AbstractButtonWidget
net.minecraft.client.gui.widget.AbstractPressableButtonWidget
net.minecraft.client.gui.widget.CyclingButtonWidget<T>
- All Implemented Interfaces:
Drawable
,Element
,OrderableTooltip
@Environment(CLIENT) public class CyclingButtonWidget<T> extends AbstractPressableButtonWidget implements OrderableTooltip
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CyclingButtonWidget.Builder<T>
static interface
CyclingButtonWidget.class_5678<T>
static interface
CyclingButtonWidget.class_5679<T>
(package private) static interface
CyclingButtonWidget.class_5680<T>
-
Field Summary
Fields Modifier and Type Field Description private static BooleanSupplier
field_27961
private static List<Boolean>
field_27962
private Text
field_27963
private CyclingButtonWidget.class_5680<T>
field_27966
private Function<T,Text>
field_27967
private Function<CyclingButtonWidget<T>,MutableText>
field_27968
private CyclingButtonWidget.class_5678<T>
field_27969
private CyclingButtonWidget.class_5679<T>
field_27970
private boolean
field_27971
private int
index
private T
value
Fields inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
-
Constructor Summary
Constructors Modifier Constructor Description private
CyclingButtonWidget(int int2, int int3, int int4, int int5, Text text, Text text2, int int6, T t, CyclingButtonWidget.class_5680<T> class_5680, Function<T,Text> function, Function<CyclingButtonWidget<T>,MutableText> function2, CyclingButtonWidget.class_5678<T> class_5678, CyclingButtonWidget.class_5679<T> class_5679, boolean bool)
-
Method Summary
Modifier and Type Method Description private void
cycle(int amount)
protected MutableText
getNarrationMessage()
List<OrderedText>
getOrderedTooltip()
T
getValue()
void
method_32605(T value)
static <T> CyclingButtonWidget.Builder<T>
method_32606(Function<T,Text> function)
static CyclingButtonWidget.Builder<Boolean>
method_32607(Text text, Text text2)
private void
method_32609(T value)
private MutableText
method_32610(T value)
MutableText
method_32611()
static CyclingButtonWidget.Builder<Boolean>
method_32613(boolean bool)
static CyclingButtonWidget.Builder<Boolean>
method_32614()
boolean
mouseScrolled(double mouseX, double mouseY, double amount)
Callback for when a mouse button scroll event has been captured.void
onPress()
Methods inherited from class net.minecraft.client.gui.widget.AbstractPressableButtonWidget
keyPressed, onClick
Methods inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
changeFocus, clicked, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, method_32602, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, renderButton, renderToolTip, setAlpha, setFocused, setMessage, setWidth
Methods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, method_33284, setZOffset
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.Element
charTyped, keyReleased, mouseMoved
-
Field Details
-
field_27961
-
field_27962
-
field_27963
-
index
private int index -
value
-
field_27966
-
field_27967
-
field_27968
-
field_27969
-
field_27970
-
field_27971
private final boolean field_27971
-
-
Constructor Details
-
CyclingButtonWidget
private CyclingButtonWidget(int int2, int int3, int int4, int int5, Text text, Text text2, int int6, T t, CyclingButtonWidget.class_5680<T> class_5680, Function<T,Text> function, Function<CyclingButtonWidget<T>,MutableText> function2, CyclingButtonWidget.class_5678<T> class_5678, CyclingButtonWidget.class_5679<T> class_5679, boolean bool)
-
-
Method Details
-
onPress
public void onPress()- Specified by:
onPress
in classAbstractPressableButtonWidget
-
cycle
private void cycle(int amount) -
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount)Callback for when a mouse button scroll event has been captured.- Specified by:
mouseScrolled
in interfaceElement
- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mouseamount
- value is> 1
if scrolled down,< 1
if scrolled up- Returns:
true
to indicate that the event handling is successful/valid- See Also:
Mouse.onMouseScroll(long, double, double)
-
method_32605
-
method_32609
-
method_32610
-
getValue
-
getNarrationMessage
- Overrides:
getNarrationMessage
in classAbstractButtonWidget
-
method_32611
-
getOrderedTooltip
- Specified by:
getOrderedTooltip
in interfaceOrderableTooltip
-
method_32606
-
method_32607
-
method_32614
-
method_32613
-