Package net.uku3lig.ukulib.utils
Class Ukutils
java.lang.Object
net.uku3lig.ukulib.utils.Ukutils
Simple class for various utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.client.option.SimpleOption<Boolean>createButton(String key, Object value, Consumer<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button.static net.minecraft.client.option.SimpleOption<Boolean>createButton(String key, net.minecraft.text.Text text, Consumer<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button.static net.minecraft.client.option.SimpleOption<Boolean>createOpenButton(String key, Object value, UnaryOperator<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button.static net.minecraft.client.option.SimpleOption<Boolean>createOpenButton(String key, net.minecraft.text.Text text, UnaryOperator<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button that opens a screen when clicked.
-
Method Details
-
createButton
public static net.minecraft.client.option.SimpleOption<Boolean> createButton(String key, Object value, Consumer<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button. Equivalent tocreateButton(key, Text.of(String.valueOf(value)), callback).- Parameters:
key- The translation key of the button textvalue- The value to be displayed after the coloncallback- The action to be performed when the button is clicked- Returns:
- The generated option
- See Also:
-
createOpenButton
public static net.minecraft.client.option.SimpleOption<Boolean> createOpenButton(String key, Object value, UnaryOperator<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button. Equivalent tocreateOpenButton(key, Text.of(String.valueOf(value)), callback).- Parameters:
key- The translation key of the button textvalue- The value to be displayed after the coloncallback- The getter for the screen to be opened when the button is clicked- Returns:
- The generated option
- See Also:
-
createButton
public static net.minecraft.client.option.SimpleOption<Boolean> createButton(String key, net.minecraft.text.Text text, Consumer<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button.- Parameters:
key- The translation key of the button texttext- The text to be displayed after the coloncallback- The action to be performed when the button is clicked- Returns:
- The generated option
-
createOpenButton
public static net.minecraft.client.option.SimpleOption<Boolean> createOpenButton(String key, net.minecraft.text.Text text, UnaryOperator<net.minecraft.client.gui.screen.Screen> callback) Creates aSimpleOptionwhich acts as a simple button that opens a screen when clicked.- Parameters:
key- The translation key of the button texttext- The text to be displayed after the coloncallback- The getter for the screen to be opened when the button is clicked- Returns:
- The generated option
-