Class BaseChunk
java.lang.Object
com.viaversion.viaversion.api.minecraft.chunks.BaseChunk
- All Implemented Interfaces:
Chunk
-
Field Summary
Modifier and TypeFieldDescriptionprotected int[]
protected int
protected final List<com.viaversion.nbt.tag.CompoundTag>
protected BitSet
protected final boolean
protected com.viaversion.nbt.tag.CompoundTag
protected boolean
protected ChunkSection[]
protected final int
protected final int
-
Constructor Summary
ConstructorDescriptionBaseChunk
(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
(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, List<com.viaversion.nbt.tag.CompoundTag> blockEntities) 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) -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of block entities.int @Nullable []
Returns the chunk's raw biome data.int
Returns the chunk section bit mask for chunks < 1.17.List<com.viaversion.nbt.tag.CompoundTag>
Returns a list of block entities.@Nullable BitSet
Returns the chunk section bit mask, only non-null for 1.17+ chunks.@Nullable com.viaversion.nbt.tag.CompoundTag
Returns a compoundtag containing the chunk's heightmaps if present.Returns an array of nullable chunk section entries.int
getX()
Returns the chunk x coordinate.int
getZ()
Returns the chunk z coordinate.boolean
Returns whether this chunk holds biome data, always true for 1.17+ chunks.boolean
Returns whether this is a full chunk, always true for 1.17+ chunks.boolean
void
setBiomeData
(int @Nullable [] biomeData) void
setBitmask
(int bitmask) void
setChunkMask
(BitSet chunkSectionMask) void
setHeightMap
(com.viaversion.nbt.tag.CompoundTag heightMap) void
setIgnoreOldLightData
(boolean ignoreOldLightData) void
setSections
(ChunkSection[] sections)
-
Field Details
-
x
protected final int x -
z
protected final int z -
fullChunk
protected final boolean fullChunk -
ignoreOldLightData
protected boolean ignoreOldLightData -
chunkSectionBitSet
-
bitmask
protected int bitmask -
sections
-
biomeData
protected int[] biomeData -
heightMap
protected com.viaversion.nbt.tag.CompoundTag heightMap -
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 interfaceChunk
- Returns:
- true if this chunk holds biome data
-
getX
public int getX()Description copied from interface:Chunk
Returns the chunk x coordinate. -
getZ
public int getZ()Description copied from interface:Chunk
Returns the 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 interfaceChunk
- Returns:
- true if this is a full chunk
-
isIgnoreOldLightData
public boolean isIgnoreOldLightData()- Specified by:
isIgnoreOldLightData
in interfaceChunk
-
setIgnoreOldLightData
public void setIgnoreOldLightData(boolean ignoreOldLightData) - Specified by:
setIgnoreOldLightData
in interfaceChunk
-
getBitmask
public int getBitmask()Description copied from interface:Chunk
Returns the chunk section bit mask for chunks < 1.17.- Specified by:
getBitmask
in interfaceChunk
- Returns:
- chunk section bit mask for chunks < 1.17
- See Also:
-
setBitmask
public void setBitmask(int bitmask) - Specified by:
setBitmask
in interfaceChunk
-
getChunkMask
Description copied from interface:Chunk
Returns the chunk section bit mask, only non-null for 1.17+ chunks.- Specified by:
getChunkMask
in interfaceChunk
- Returns:
- chunk section bit mask, only non-null for 1.17+ chunks
- See Also:
-
setChunkMask
- Specified by:
setChunkMask
in interfaceChunk
-
getSections
Description copied from interface:Chunk
Returns an array of nullable chunk section entries.- Specified by:
getSections
in interfaceChunk
- Returns:
- array of nullable chunk sections
-
setSections
- Specified by:
setSections
in interfaceChunk
-
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 interfaceChunk
- Returns:
- raw biome data
-
setBiomeData
public void setBiomeData(int @Nullable [] biomeData) - Specified by:
setBiomeData
in interfaceChunk
-
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 interfaceChunk
- Returns:
- compoundtag containing heightmaps if present
-
setHeightMap
public void setHeightMap(com.viaversion.nbt.tag.CompoundTag heightMap) - Specified by:
setHeightMap
in interfaceChunk
-
getBlockEntities
Description copied from interface:Chunk
Returns a list of block entities.- Specified by:
getBlockEntities
in interfaceChunk
- Returns:
- list of block entities
-
blockEntities
Description copied from interface:Chunk
Returns a list of block entities.- Specified by:
blockEntities
in interfaceChunk
- Returns:
- list of block entities
-