Class IntRangeSetting
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemSetting<Integer>
io.github.thebusybiscuit.slimefun4.api.items.settings.IntRangeSetting
This variation of
ItemSetting allows you to define an Integer range
and enforces this range using the validateInput(Integer) method.- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIntRangeSetting(SlimefunItem item, String key, int min, int defaultValue, int max) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringThis is an error message which should provide further context on what values are allowed.final intThis returns the maximum value of thisIntRangeSetting.final intThis returns the minimum value of thisIntRangeSetting.booleanvalidateInput(Integer input) This method checks if a given input would be valid as a value for thisItemSetting.
-
Constructor Details
-
IntRangeSetting
@ParametersAreNonnullByDefault public IntRangeSetting(SlimefunItem item, String key, int min, int defaultValue, int max)
-
-
Method Details
-
getErrorMessage
Description copied from class:ItemSettingThis is an error message which should provide further context on what values are allowed.- Overrides:
getErrorMessagein classItemSetting<Integer>- Returns:
- An error message which is displayed when this
ItemSettingis misconfigured.
-
validateInput
Description copied from class:ItemSettingThis 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:
validateInputin classItemSetting<Integer>- Parameters:
input- The input value to validate- Returns:
- Whether the given input was valid
-
getMinimum
public final int getMinimum()This returns the minimum value of thisIntRangeSetting.- Returns:
- The minimum value
-
getMaximum
public final int getMaximum()This returns the maximum value of thisIntRangeSetting.- Returns:
- The maximum value
-