Class IdRanges

java.lang.Object
com.viaversion.viaversion.api.data.IdRanges

public final class IdRanges extends Object
Reads sets of non-negative ints stored as ranges, packed into a byte array of varints. Each range is stored as an offset and length pair. The offset is the start of the first range and the difference to the previous range's exclusive end; the length is the inclusive end minus the start.
  • Constructor Details

    • IdRanges

      public IdRanges()
  • Method Details

    • decode

      public static it.unimi.dsi.fastutil.ints.IntSet decode(com.viaversion.nbt.tag.ByteArrayTag rangesTag)
      Returns the encoded id set as an int set.
      Parameters:
      rangesTag - tag with the encoded ranges
      Returns:
      decoded ids
    • forEachId

      public static void forEachId(com.viaversion.nbt.tag.ByteArrayTag rangesTag, IntConsumer consumer)