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

public class ViaBooleanInput extends ViaDialogInput implements BooleanInput<ViaBooleanInput>
A ViaVersion-based implementation of BooleanInput for boolean inputs.
  • Constructor Details

    • ViaBooleanInput

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

    • label

      public ViaBooleanInput label(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 ViaBooleanInput label(String label)
      Description copied from interface: BooleanInput
      Set the label for the input.
      Specified by:
      label in interface BooleanInput<ViaBooleanInput>
      Parameters:
      label - the label to display for the input
      Returns:
      the current instance for method chaining
    • initial

      public ViaBooleanInput initial(boolean initial)
      Description copied from interface: BooleanInput
      Set the initial value of the boolean input.
      Specified by:
      initial in interface BooleanInput<ViaBooleanInput>
      Parameters:
      initial - the initial value (true or false)
      Returns:
      the current instance for method chaining
    • onTrue

      public ViaBooleanInput onTrue(String onTrue)
      Description copied from interface: BooleanInput
      Set the text to be sent when the input is true.
      Specified by:
      onTrue in interface BooleanInput<ViaBooleanInput>
      Parameters:
      onTrue - the text to be sent when the input is true
      Returns:
      the current instance for method chaining
    • onFalse

      public ViaBooleanInput onFalse(String onFalse)
      Description copied from interface: BooleanInput
      Set the text to be sent when the input is false.
      Specified by:
      onFalse in interface BooleanInput<ViaBooleanInput>
      Parameters:
      onFalse - the text to be sent when the input is false
      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