java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemSetting<Integer>
io.github.thebusybiscuit.slimefun4.api.items.settings.IntRangeSetting

public class IntRangeSetting extends ItemSetting<Integer>
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 Details

    • IntRangeSetting

      @ParametersAreNonnullByDefault public IntRangeSetting(SlimefunItem item, String key, int min, int defaultValue, int max)
  • Method Details

    • getErrorMessage

      @Nonnull protected String getErrorMessage()
      Description copied from class: ItemSetting
      This is an error message which should provide further context on what values are allowed.
      Overrides:
      getErrorMessage in class ItemSetting<Integer>
      Returns:
      An error message which is displayed when this ItemSetting is misconfigured.
    • validateInput

      public boolean validateInput(Integer input)
      Description copied from class: ItemSetting
      This method checks if a given input would be valid as a value for this ItemSetting. You can override this method to implement your own checks.
      Overrides:
      validateInput in class ItemSetting<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 this IntRangeSetting.
      Returns:
      The minimum value
    • getMaximum

      public final int getMaximum()
      This returns the maximum value of this IntRangeSetting.
      Returns:
      The maximum value