Class ViaNumberRangeInput
java.lang.Object
io.github.projectunified.unidialog.viaversion.input.ViaDialogInput
io.github.projectunified.unidialog.viaversion.input.ViaNumberRangeInput
- All Implemented Interfaces:
NumberRangeInput<ViaNumberRangeInput>
public class ViaNumberRangeInput
extends ViaDialogInput
implements NumberRangeInput<ViaNumberRangeInput>
A ViaVersion-based implementation of
NumberRangeInput for number range inputs.-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.input.NumberRangeInput
DEFAULT_LABEL_FORMAT, DEFAULT_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViaNumberRangeInput(Function<String, com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer) Constructor for ViaNumberRangeInput -
Method Summary
Modifier and TypeMethodDescriptionend(float end) Set the end value of the rangeSet the initial value of the rangelabel(com.viaversion.viaversion.libs.mcstructs.text.TextComponent label) Set the label for the inputSet the label for the inputlabelFormat(String labelFormat) Set the format for the labelstart(float start) Set the start value of the rangeSet the step value for the rangewidth(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:NumberRangeInputSet the width of the input- Specified by:
widthin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
width- the width- Returns:
- the current instance for method chaining
-
label
Set the label for the input- Parameters:
label- the label- Returns:
- the input itself for method chaining
-
label
Description copied from interface:NumberRangeInputSet the label for the input- Specified by:
labelin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
label- the label text- Returns:
- the current instance for method chaining
-
labelFormat
Description copied from interface:NumberRangeInputSet the format for the label- Specified by:
labelFormatin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
labelFormat- the format string for the label- Returns:
- the current instance for method chaining
-
start
Description copied from interface:NumberRangeInputSet the start value of the range- Specified by:
startin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
start- the start value- Returns:
- the current instance for method chaining
-
end
Description copied from interface:NumberRangeInputSet the end value of the range- Specified by:
endin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
end- the end value- Returns:
- the current instance for method chaining
-
initial
Description copied from interface:NumberRangeInputSet the initial value of the range- Specified by:
initialin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
initial- the initial value, can be null- Returns:
- the current instance for method chaining
-
step
Description copied from interface:NumberRangeInputSet the step value for the range- Specified by:
stepin interfaceNumberRangeInput<ViaNumberRangeInput>- Parameters:
step- the step value, can be null- 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
-