Package net.uku3lig.ukulib.config.option
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.screen.Screen> opener) Creates a new button. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.widget.ClickableWidgetcreateWidget(int x, int y, int width, int height) Creates the widget.
-
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.widget.ClickableWidget 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
-