Class ViaSingleOptionInput
java.lang.Object
io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
io.github.projectunified.unidialog.viaversion.input.ViaSingleOptionInput
- All Implemented Interfaces:
SingleOptionInput<ViaSingleOptionInput>
public class ViaSingleOptionInput
extends ViaDialogInput
implements SingleOptionInput<ViaSingleOptionInput>
A ViaVersion-based implementation of
SingleOptionInput for single option inputs.-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.input.SingleOptionInput
DEFAULT_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViaSingleOptionInput(Function<String, com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer) Constructor for ViaSingleOptionInput -
Method Summary
Modifier and TypeMethodDescriptionlabel(@Nullable com.viaversion.viaversion.libs.mcstructs.text.TextComponent label) Set the label for the inputSet the label for the inputoption(String id, com.viaversion.viaversion.libs.mcstructs.text.TextComponent display, boolean isDefault) Add an option to the inputAdd an option to 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
getComponentDeserializerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.unidialog.core.input.SingleOptionInput
option
-
Constructor Details
-
Method Details
-
width
Description copied from interface:SingleOptionInputSet the width of the input- Specified by:
widthin interfaceSingleOptionInput<ViaSingleOptionInput>- Parameters:
width- the width- Returns:
- the current instance for method chaining
-
label
public ViaSingleOptionInput 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:SingleOptionInputSet the label for the input- Specified by:
labelin interfaceSingleOptionInput<ViaSingleOptionInput>- Parameters:
label- the label text- Returns:
- the current instance for method chaining
-
option
public ViaSingleOptionInput option(String id, com.viaversion.viaversion.libs.mcstructs.text.TextComponent display, boolean isDefault) Add an option to the input- Parameters:
id- the identifier for the optiondisplay- the display text for the optionisDefault- whether this option is the default selection- Returns:
- the input itself for method chaining
-
option
Description copied from interface:SingleOptionInputAdd an option to the input- Specified by:
optionin interfaceSingleOptionInput<ViaSingleOptionInput>- Parameters:
id- the identifier for the optiondisplay- the display text for the optionisDefault- whether this option is the default selection- 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
-