Class IntRange
java.lang.Object
com.portingdeadmods.portingdeadlibs.utils.ranges.AbstractRange<Integer>
com.portingdeadmods.portingdeadlibs.utils.ranges.IntRange
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Integer> Collects all possible values in the range specified.protected Collection<Integer> collectPossibleValues(Integer step) Collects all possible values in the range specified.static IntRangeof(int min, int max) Creates a newIntRangewith the specified minimum and maximum values.static IntRangeof(int min, int max, int step) Creates a newIntRangewith the specified minimum, maximum and step values.Utility method to create a new range shifted by a specified offset.Methods inherited from class com.portingdeadmods.portingdeadlibs.utils.ranges.AbstractRange
fits, getMax, getMin, getPossibleValues, rangeMapCodec, rangeStreamCodec
-
Field Details
-
MAP_CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,IntRange> STREAM_CODEC
-
-
Constructor Details
-
IntRange
-
IntRange
-
-
Method Details
-
collectPossibleValues
Description copied from class:AbstractRangeCollects all possible values in the range specified. Default step of 1.0f is used.- Specified by:
collectPossibleValuesin classAbstractRange<Integer>- Returns:
- A collection of all possible float values in the range with a step of 1.0f.
-
collectPossibleValues
Description copied from class:AbstractRangeCollects all possible values in the range specified.- Specified by:
collectPossibleValuesin classAbstractRange<Integer>- Parameters:
step- The step value to use for collecting possible values.- Returns:
- A collection of all possible float values in the range with a step of 1.0f.
-
shift
Description copied from class:AbstractRangeUtility method to create a new range shifted by a specified offset.- Specified by:
shiftin classAbstractRange<Integer>- Parameters:
offset- The offset to shift the range by.- Returns:
- A new range that is shifted by the specified offset.
-
of
Creates a newIntRangewith the specified minimum and maximum values.- Parameters:
min- The minimum value (inclusive).max- The maximum value (inclusive).- Returns:
- A new IntRange instance with the specified values
-
of
Creates a newIntRangewith the specified minimum, maximum and step values.- Parameters:
min- The minimum value (inclusive).max- The maximum value (inclusive).step- The step value to use when generating the range.- Returns:
- A new IntRange instance with the specified values
-