Class ViaTextInput
java.lang.Object
io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
io.github.projectunified.unidialog.viaversion.input.ViaTextInput
- All Implemented Interfaces:
TextInput<ViaTextInput>
A ViaVersion-based implementation of
TextInput for text inputs.-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.input.TextInput
DEFAULT_MAX_LENGTH, DEFAULT_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViaTextInput(Function<String, com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer) Constructor for ViaTextInput -
Method Summary
Modifier and TypeMethodDescriptionSet the height of the inputSet the initial value for the inputlabel(@Nullable com.viaversion.viaversion.libs.mcstructs.text.TextComponent label) Set the label for the inputSet the label for the inputmaxLength(int maxLength) Set the maximum length of the input textSet the maximum number of lines for the inputwidth(int width) Set the width of the inputvoidwrite(com.viaversion.nbt.tag.CompoundTag tag, com.viaversion.viaversion.util.SerializerVersion baseVersion, com.viaversion.viaversion.util.SerializerVersion targetVersion) Write the type-specific fields of this input into the given tagMethods inherited from class io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
getComponentDeserializer
-
Constructor Details
-
Method Details
-
width
Description copied from interface:TextInputSet the width of the input- Specified by:
widthin interfaceTextInput<ViaTextInput>- Parameters:
width- the width- Returns:
- the current instance for method chaining
-
label
public ViaTextInput label(@Nullable @Nullable com.viaversion.viaversion.libs.mcstructs.text.TextComponent label) Set the label for the input- Parameters:
label- the label- Returns:
- the input itself for method chaining
-
label
Description copied from interface:TextInputSet the label for the input- Specified by:
labelin interfaceTextInput<ViaTextInput>- Parameters:
label- the label text- Returns:
- the current instance for method chaining
-
initial
Description copied from interface:TextInputSet the initial value for the input- Specified by:
initialin interfaceTextInput<ViaTextInput>- Parameters:
initial- the initial text- Returns:
- the current instance for method chaining
-
maxLength
Description copied from interface:TextInputSet the maximum length of the input text- Specified by:
maxLengthin interfaceTextInput<ViaTextInput>- Parameters:
maxLength- the maximum number of characters allowed- Returns:
- the current instance for method chaining
-
maxLines
Description copied from interface:TextInputSet the maximum number of lines for the input- Specified by:
maxLinesin interfaceTextInput<ViaTextInput>- Parameters:
maxLines- the maximum number of lines allowed- Returns:
- the current instance for method chaining
-
height
Description copied from interface:TextInputSet the height of the input- Specified by:
heightin interfaceTextInput<ViaTextInput>- Parameters:
height- the height- Returns:
- the current instance for method chaining
-
write
public void write(com.viaversion.nbt.tag.CompoundTag tag, com.viaversion.viaversion.util.SerializerVersion baseVersion, com.viaversion.viaversion.util.SerializerVersion targetVersion) Description copied from class:ViaDialogInputWrite the type-specific fields of this input into the given tag- Specified by:
writein classViaDialogInput- Parameters:
tag- the tag to write intobaseVersion- the serializer of the server version the dialog is created fortargetVersion- the serializer of the version the dialog is sent to
-