java.lang.Object
io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
io.github.projectunified.unidialog.viaversion.input.ViaTextInput
All Implemented Interfaces:
TextInput<ViaTextInput>

public class ViaTextInput extends ViaDialogInput implements TextInput<ViaTextInput>
A ViaVersion-based implementation of TextInput for text inputs.
  • Constructor Details

    • ViaTextInput

      public ViaTextInput(Function<String,com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer)
      Constructor for ViaTextInput
      Parameters:
      componentDeserializer - the function to deserialize components from strings
  • Method Details

    • width

      public ViaTextInput width(int width)
      Description copied from interface: TextInput
      Set the width of the input
      Specified by:
      width in interface TextInput<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

      public ViaTextInput label(@Nullable @Nullable String label)
      Description copied from interface: TextInput
      Set the label for the input
      Specified by:
      label in interface TextInput<ViaTextInput>
      Parameters:
      label - the label text
      Returns:
      the current instance for method chaining
    • initial

      public ViaTextInput initial(String initial)
      Description copied from interface: TextInput
      Set the initial value for the input
      Specified by:
      initial in interface TextInput<ViaTextInput>
      Parameters:
      initial - the initial text
      Returns:
      the current instance for method chaining
    • maxLength

      public ViaTextInput maxLength(int maxLength)
      Description copied from interface: TextInput
      Set the maximum length of the input text
      Specified by:
      maxLength in interface TextInput<ViaTextInput>
      Parameters:
      maxLength - the maximum number of characters allowed
      Returns:
      the current instance for method chaining
    • maxLines

      public ViaTextInput maxLines(@Nullable @Nullable Integer maxLines)
      Description copied from interface: TextInput
      Set the maximum number of lines for the input
      Specified by:
      maxLines in interface TextInput<ViaTextInput>
      Parameters:
      maxLines - the maximum number of lines allowed
      Returns:
      the current instance for method chaining
    • height

      public ViaTextInput height(@Nullable @Nullable Integer height)
      Description copied from interface: TextInput
      Set the height of the input
      Specified by:
      height in interface TextInput<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: ViaDialogInput
      Write the type-specific fields of this input into the given tag
      Specified by:
      write in class ViaDialogInput
      Parameters:
      tag - the tag to write into
      baseVersion - the serializer of the server version the dialog is created for
      targetVersion - the serializer of the version the dialog is sent to