java.lang.Object
com.portingdeadmods.portingdeadlibs.utils.ranges.AbstractRange<Float>
com.portingdeadmods.portingdeadlibs.utils.ranges.FloatRange

public class FloatRange extends AbstractRange<Float>
  • Field Details

    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<FloatRange> MAP_CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FloatRange> STREAM_CODEC
  • Constructor Details

    • FloatRange

      protected FloatRange(Float minInclusive, Float maxInclusive, Float step)
    • FloatRange

      protected FloatRange(Float minInclusive, Float maxInclusive)
  • Method Details

    • collectPossibleValues

      protected Collection<Float> collectPossibleValues(Float step)
      Description copied from class: AbstractRange
      Collects all possible values in the range specified.
      Specified by:
      collectPossibleValues in class AbstractRange<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

      protected Collection<Float> collectPossibleValues()
      Description copied from class: AbstractRange
      Collects all possible values in the range specified. Default step of 1.0f is used.
      Specified by:
      collectPossibleValues in class AbstractRange<Float>
      Returns:
      A collection of all possible float values in the range with a step of 1.0f.
    • shift

      public FloatRange shift(Float offset)
      Description copied from class: AbstractRange
      Utility method to create a new range shifted by a specified offset.
      Specified by:
      shift in class AbstractRange<Float>
      Parameters:
      offset - The offset to shift the range by.
      Returns:
      A new range that is shifted by the specified offset.
    • of

      public static FloatRange of(float min, float max)
      Creates a new FloatRange with 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

      public static FloatRange of(float min, float max, float step)
      Creates a new FloatRange with 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