Class ScreenOpenButton
java.lang.Object
net.uku3lig.ukulib.config.option.ScreenOpenButton
- All Implemented Interfaces:
WidgetCreator
A button that opens a screen when clicked.
-
Constructor Summary
ConstructorsConstructorDescriptionScreenOpenButton(String key, UnaryOperator<net.minecraft.client.gui.screens.Screen> opener) Creates a new button. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.components.AbstractWidgetcreateWidget(int x, int y, int width, int height) Creates the widget.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WidgetCreator
createWidget, wide
-
Constructor Details
-
ScreenOpenButton
Creates a new button.- Parameters:
key- The translation key of the textopener- The supplier for the new screen. The lambda parameter is the current screen when the button is pressed.
-
-
Method Details
-
createWidget
public net.minecraft.client.gui.components.AbstractWidget createWidget(int x, int y, int width, int height) Description copied from interface:WidgetCreatorCreates the widget.- Specified by:
createWidgetin interfaceWidgetCreator- Parameters:
x- The x positiony- The y positionwidth- The widget widthheight- The widget height- Returns:
- The created widget
-