Class DoubleRangeSetting
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemSetting<Double>
io.github.thebusybiscuit.slimefun4.api.items.settings.DoubleRangeSetting
- Direct Known Subclasses:
ClimbableSurface
This variation of
ItemSetting
allows you to define an Double
range
and enforces this range using the validateInput(Double)
method.- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
ConstructorDescriptionDoubleRangeSetting
(SlimefunItem item, String key, double min, double defaultValue, double max) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
This is an error message which should provide further context on what values are allowed.final double
This returns the maximum value of thisDoubleRangeSetting
.final double
This returns the minimum value of thisDoubleRangeSetting
.boolean
validateInput
(Double input) This method checks if a given input would be valid as a value for thisItemSetting
.
-
Constructor Details
-
DoubleRangeSetting
@ParametersAreNonnullByDefault public DoubleRangeSetting(SlimefunItem item, String key, double min, double defaultValue, double max)
-
-
Method Details
-
getErrorMessage
Description copied from class:ItemSetting
This is an error message which should provide further context on what values are allowed.- Overrides:
getErrorMessage
in classItemSetting<Double>
- Returns:
- An error message which is displayed when this
ItemSetting
is misconfigured.
-
validateInput
Description copied from class:ItemSetting
This method checks if a given input would be valid as a value for thisItemSetting
. You can override this method to implement your own checks.- Overrides:
validateInput
in classItemSetting<Double>
- Parameters:
input
- The input value to validate- Returns:
- Whether the given input was valid
-
getMinimum
public final double getMinimum()This returns the minimum value of thisDoubleRangeSetting
.- Returns:
- The minimum value
-
getMaximum
public final double getMaximum()This returns the maximum value of thisDoubleRangeSetting
.- Returns:
- The maximum value
-