Class FloatRange
java.lang.Object
com.portingdeadmods.portingdeadlibs.utils.ranges.AbstractRange<Float>
com.portingdeadmods.portingdeadlibs.utils.ranges.FloatRange
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<FloatRange> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FloatRange> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFloatRange(Float minInclusive, Float maxInclusive) protectedFloatRange(Float minInclusive, Float maxInclusive, Float step) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Float> Collects all possible values in the range specified.protected Collection<Float> collectPossibleValues(Float step) Collects all possible values in the range specified.static FloatRangeof(float min, float max) Creates a newFloatRangewith the specified minimum and maximum values.static FloatRangeof(float min, float max, float step) Creates a newFloatRangewith the specified minimum and maximum 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,FloatRange> STREAM_CODEC
-
-
Constructor Details
-
FloatRange
-
FloatRange
-
-
Method Details
-
collectPossibleValues
Description copied from class:AbstractRangeCollects all possible values in the range specified.- Specified by:
collectPossibleValuesin classAbstractRange<Float>- 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.
-
collectPossibleValues
Description copied from class:AbstractRangeCollects all possible values in the range specified. Default step of 1.0f is used.- Specified by:
collectPossibleValuesin classAbstractRange<Float>- 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<Float>- Parameters:
offset- The offset to shift the range by.- Returns:
- A new range that is shifted by the specified offset.
-
of
Creates a newFloatRangewith the specified minimum and maximum values.- Parameters:
min- The minimum value (inclusive).max- The maximum value (inclusive).- Returns:
- A new FloatRange instance with the specified values
-
of
Creates a newFloatRangewith the specified minimum and maximum 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 FloatRange instance with the specified values
-