java.lang.Object
com.portingdeadmods.portingdeadlibs.utils.ranges.AbstractRange<Integer>
com.portingdeadmods.portingdeadlibs.utils.ranges.IntRange

public class IntRange extends AbstractRange<Integer>
  • Field Details

    • MAP_CODEC

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

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

  • Method Details

    • collectPossibleValues

      protected Collection<Integer> 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<Integer>
      Returns:
      A collection of all possible float values in the range with a step of 1.0f.
    • collectPossibleValues

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

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

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

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