java.lang.Object
com.viaversion.viaversion.api.minecraft.chunks.BaseChunk
All Implemented Interfaces:
Chunk

public class BaseChunk extends Object implements Chunk
  • Field Details

    • x

      protected final int x
    • z

      protected final int z
    • fullChunk

      protected final boolean fullChunk
    • ignoreOldLightData

      protected boolean ignoreOldLightData
    • chunkSectionBitSet

      protected BitSet chunkSectionBitSet
    • bitmask

      protected int bitmask
    • sections

      protected ChunkSection[] sections
    • biomeData

      protected int[] biomeData
    • heightMap

      protected com.viaversion.nbt.tag.CompoundTag heightMap
    • blockEntities

      protected final List<com.viaversion.nbt.tag.CompoundTag> blockEntities
  • Constructor Details

    • BaseChunk

      public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, @Nullable BitSet chunkSectionBitSet, ChunkSection[] sections, int @Nullable [] biomeData, @Nullable com.viaversion.nbt.tag.CompoundTag heightMap, List<com.viaversion.nbt.tag.CompoundTag> blockEntities)
    • BaseChunk

      public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, com.viaversion.nbt.tag.CompoundTag heightMap, List<com.viaversion.nbt.tag.CompoundTag> blockEntities)
    • BaseChunk

      public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, List<com.viaversion.nbt.tag.CompoundTag> blockEntities)
  • Method Details

    • isBiomeData

      public boolean isBiomeData()
      Description copied from interface: Chunk
      Returns whether this chunk holds biome data, always true for 1.17+ chunks.
      Specified by:
      isBiomeData in interface Chunk
      Returns:
      true if this chunk holds biome data
    • getX

      public int getX()
      Description copied from interface: Chunk
      Returns the chunk x coordinate.
      Specified by:
      getX in interface Chunk
      Returns:
      chunk x coordinate
    • getZ

      public int getZ()
      Description copied from interface: Chunk
      Returns the chunk z coordinate.
      Specified by:
      getZ in interface Chunk
      Returns:
      chunk z coordinate
    • isFullChunk

      public boolean isFullChunk()
      Description copied from interface: Chunk
      Returns whether this is a full chunk, always true for 1.17+ chunks.
      Specified by:
      isFullChunk in interface Chunk
      Returns:
      true if this is a full chunk
    • isIgnoreOldLightData

      public boolean isIgnoreOldLightData()
      Specified by:
      isIgnoreOldLightData in interface Chunk
    • setIgnoreOldLightData

      public void setIgnoreOldLightData(boolean ignoreOldLightData)
      Specified by:
      setIgnoreOldLightData in interface Chunk
    • getBitmask

      public int getBitmask()
      Description copied from interface: Chunk
      Returns the chunk section bit mask for chunks < 1.17.
      Specified by:
      getBitmask in interface Chunk
      Returns:
      chunk section bit mask for chunks < 1.17
      See Also:
    • setBitmask

      public void setBitmask(int bitmask)
      Specified by:
      setBitmask in interface Chunk
    • getChunkMask

      public @Nullable BitSet getChunkMask()
      Description copied from interface: Chunk
      Returns the chunk section bit mask, only non-null for 1.17+ chunks.
      Specified by:
      getChunkMask in interface Chunk
      Returns:
      chunk section bit mask, only non-null for 1.17+ chunks
      See Also:
    • setChunkMask

      public void setChunkMask(BitSet chunkSectionMask)
      Specified by:
      setChunkMask in interface Chunk
    • getSections

      public ChunkSection[] getSections()
      Description copied from interface: Chunk
      Returns an array of nullable chunk section entries.
      Specified by:
      getSections in interface Chunk
      Returns:
      array of nullable chunk sections
    • setSections

      public void setSections(ChunkSection[] sections)
      Specified by:
      setSections in interface Chunk
    • getBiomeData

      public int @Nullable [] getBiomeData()
      Description copied from interface: Chunk
      Returns the chunk's raw biome data. The format the biomes are stored may vary.
      Specified by:
      getBiomeData in interface Chunk
      Returns:
      raw biome data
    • setBiomeData

      public void setBiomeData(int @Nullable [] biomeData)
      Specified by:
      setBiomeData in interface Chunk
    • getHeightMap

      public @Nullable com.viaversion.nbt.tag.CompoundTag getHeightMap()
      Description copied from interface: Chunk
      Returns a compoundtag containing the chunk's heightmaps if present.
      Specified by:
      getHeightMap in interface Chunk
      Returns:
      compoundtag containing heightmaps if present
    • setHeightMap

      public void setHeightMap(com.viaversion.nbt.tag.CompoundTag heightMap)
      Specified by:
      setHeightMap in interface Chunk
    • getBlockEntities

      public List<com.viaversion.nbt.tag.CompoundTag> getBlockEntities()
      Description copied from interface: Chunk
      Returns a list of block entities.
      Specified by:
      getBlockEntities in interface Chunk
      Returns:
      list of block entities
    • blockEntities

      public List<BlockEntity> blockEntities()
      Description copied from interface: Chunk
      Returns a list of block entities.
      Specified by:
      blockEntities in interface Chunk
      Returns:
      list of block entities