Class ViaBooleanInput
java.lang.Object
io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
io.github.projectunified.unidialog.viaversion.input.ViaBooleanInput
- All Implemented Interfaces:
BooleanInput<ViaBooleanInput>
A ViaVersion-based implementation of
BooleanInput for boolean inputs.-
Constructor Summary
ConstructorsConstructorDescriptionViaBooleanInput(Function<String, com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer) Constructor for ViaBooleanInput -
Method Summary
Modifier and TypeMethodDescriptioninitial(boolean initial) Set the initial value of the boolean input.label(com.viaversion.viaversion.libs.mcstructs.text.TextComponent label) Set the label for the inputSet the label for the input.Set the text to be sent when the input is false.Set the text to be sent when the input is true.voidwrite(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
-
label
Set the label for the input- Parameters:
label- the label- Returns:
- the input itself for method chaining
-
label
Description copied from interface:BooleanInputSet the label for the input.- Specified by:
labelin interfaceBooleanInput<ViaBooleanInput>- Parameters:
label- the label to display for the input- Returns:
- the current instance for method chaining
-
initial
Description copied from interface:BooleanInputSet the initial value of the boolean input.- Specified by:
initialin interfaceBooleanInput<ViaBooleanInput>- Parameters:
initial- the initial value (true or false)- Returns:
- the current instance for method chaining
-
onTrue
Description copied from interface:BooleanInputSet the text to be sent when the input is true.- Specified by:
onTruein interfaceBooleanInput<ViaBooleanInput>- Parameters:
onTrue- the text to be sent when the input is true- Returns:
- the current instance for method chaining
-
onFalse
Description copied from interface:BooleanInputSet the text to be sent when the input is false.- Specified by:
onFalsein interfaceBooleanInput<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: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
-