Class RegionBitmap

java.lang.Object
net.minecraft.world.level.chunk.storage.RegionBitmap

public class RegionBitmap extends Object
Keeps track of which parts of a region file are used and which parts are free.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BitSet
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    allocate(int pSectorCount)
    Gets a valid offset inside the region file with enough space to store the given amount of sectors and marks that space as used.
    void
    force(int pSectorOffset, int pSectorCount)
    Marks a range of 4 KiB sectors relative to the region file as used.
    void
    free(int pSectorOffset, int pSectorCount)
    Marks a range of 4 KiB sectors relative to the region file as not used.
    it.unimi.dsi.fastutil.ints.IntSet
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • used

      private final BitSet used
  • Constructor Details

    • RegionBitmap

      public RegionBitmap()
  • Method Details

    • force

      public void force(int pSectorOffset, int pSectorCount)
      Marks a range of 4 KiB sectors relative to the region file as used.
      Parameters:
      pSectorOffset - The first sector in the range.
      pSectorCount - The amount of sectors in the range.
    • free

      public void free(int pSectorOffset, int pSectorCount)
      Marks a range of 4 KiB sectors relative to the region file as not used.
      Parameters:
      pSectorOffset - The first sector in the range.
      pSectorCount - The amount of sectors in the range.
    • allocate

      public int allocate(int pSectorCount)
      Gets a valid offset inside the region file with enough space to store the given amount of sectors and marks that space as used.
    • getUsed

      public it.unimi.dsi.fastutil.ints.IntSet getUsed()