Class BaseChunk

  • All Implemented Interfaces:
    Chunk

    public class BaseChunk
    extends java.lang.Object
    implements Chunk
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseChunk​(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap, java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)  
      BaseChunk​(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)  
      BaseChunk​(int x, int z, boolean fullChunk, boolean ignoreOldLightData, @Nullable java.util.BitSet chunkSectionBitSet, ChunkSection[] sections, int @Nullable [] biomeData, @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap, java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int @Nullable [] getBiomeData()
      Returns the chunk's raw biome data.
      int getBitmask()
      Returns the chunk section bit mask for chunks < 1.17.
      java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> getBlockEntities()
      Returns a list of block entities.
      @Nullable java.util.BitSet getChunkMask()
      Returns the chunk section bit mask, only non-null for 1.17+ chunks.
      @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag getHeightMap()
      Returns a compoundtag containing the chunk's heightmaps if present.
      ChunkSection[] getSections()
      Returns an array of nullable chunk section entries.
      int getX()
      Returns the chunk x coordinate.
      int getZ()
      Returns the chunk z coordinate.
      boolean isBiomeData()
      Returns whether this chunk holds biome data, always true for 1.17+ chunks.
      boolean isFullChunk()
      Returns whether this is a full chunk, always true for 1.17+ chunks.
      boolean isIgnoreOldLightData()  
      void setBiomeData​(int @Nullable [] biomeData)  
      void setBitmask​(int bitmask)  
      void setChunkMask​(java.util.BitSet chunkSectionMask)  
      void setHeightMap​(com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap)  
      void setIgnoreOldLightData​(boolean ignoreOldLightData)  
      void setSections​(ChunkSection[] sections)  
      • Methods inherited from class java.lang.Object

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

      • x

        protected final int x
      • z

        protected final int z
      • fullChunk

        protected final boolean fullChunk
      • ignoreOldLightData

        protected boolean ignoreOldLightData
      • chunkSectionBitSet

        protected java.util.BitSet chunkSectionBitSet
      • bitmask

        protected int bitmask
      • biomeData

        protected int[] biomeData
      • heightMap

        protected com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap
      • blockEntities

        protected final java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities
    • Constructor Detail

      • BaseChunk

        public BaseChunk​(int x,
                         int z,
                         boolean fullChunk,
                         boolean ignoreOldLightData,
                         @Nullable java.util.BitSet chunkSectionBitSet,
                         ChunkSection[] sections,
                         int @Nullable [] biomeData,
                         @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap,
                         java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)
      • BaseChunk

        public BaseChunk​(int x,
                         int z,
                         boolean fullChunk,
                         boolean ignoreOldLightData,
                         int bitmask,
                         ChunkSection[] sections,
                         int[] biomeData,
                         com.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap,
                         java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)
      • BaseChunk

        public BaseChunk​(int x,
                         int z,
                         boolean fullChunk,
                         boolean ignoreOldLightData,
                         int bitmask,
                         ChunkSection[] sections,
                         int[] biomeData,
                         java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> blockEntities)
    • Method Detail

      • 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
      • 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:
        Chunk.getChunkMask()
      • setBitmask

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

        public @Nullable java.util.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:
        Chunk.getBitmask()
      • setChunkMask

        public void setChunkMask​(java.util.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
      • 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.github.steveice10.opennbt.tag.builtin.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.github.steveice10.opennbt.tag.builtin.CompoundTag heightMap)
        Specified by:
        setHeightMap in interface Chunk
      • getBlockEntities

        public java.util.List<com.github.steveice10.opennbt.tag.builtin.CompoundTag> getBlockEntities()
        Description copied from interface: Chunk
        Returns a list of block entities.
        Specified by:
        getBlockEntities in interface Chunk
        Returns:
        list of block entities