Package net.uku3lig.ukulib.config.screen
Class TextInputScreen<T>
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.uku3lig.ukulib.config.screen.TextInputScreen<T>
- Type Parameters:
T- The type of the value.
- All Implemented Interfaces:
net.minecraft.client.gui.Drawable,net.minecraft.client.gui.Element,net.minecraft.client.gui.ParentElement
public abstract class TextInputScreen<T>
extends net.minecraft.client.gui.screen.Screen
A screen used to input a value.
Instances of this class should NOT be reused.
-
Field Summary
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, font, height, itemRenderer, minecraft, passEvents, title, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTextInputScreen(net.minecraft.client.gui.screen.Screen parent, net.minecraft.text.Text title, net.minecraft.text.Text label, Consumer<T> callback, T last, ConfigManager<?> manager) Creates an input screen. -
Method Summary
Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, children, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, shouldCloseOnEsc, tick, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fill, fillGradient, getBlitOffset, hLine, innerBlit, setBlitOffset, vLineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
-
Constructor Details
-
TextInputScreen
protected TextInputScreen(net.minecraft.client.gui.screen.Screen parent, net.minecraft.text.Text title, net.minecraft.text.Text label, Consumer<T> callback, T last, ConfigManager<?> manager) Creates an input screen.- Parameters:
parent- The parent screentitle- The title of the screenlabel- The label to be shown above the text input fieldcallback- The action to be performed when the value is changedlast- The last known valuemanager- The config manager, used to save the config
-
-
Method Details
-
init
protected void init()- Overrides:
initin classnet.minecraft.client.gui.screen.Screen
-
convert
Converts the contents of the text field to the type needed.- Parameters:
value- the value of the text field, given by the user- Returns:
- an empty optional is the value is incorrect, else the converted value
-
removed
public final void removed()- Overrides:
removedin classnet.minecraft.client.gui.screen.Screen
-
onClose
public void onClose()- Overrides:
onClosein classnet.minecraft.client.gui.screen.Screen
-
render
public void render(int mouseX, int mouseY, float delta) - Specified by:
renderin interfacenet.minecraft.client.gui.Drawable- Overrides:
renderin classnet.minecraft.client.gui.screen.Screen
-