classinternalSource
public class ChunkSection

A 16x16x16 piece of a chunk, its blocks and its biomes (one per 4x4x4 cell)

Constructors

public ChunkSection(NbtCompound sectionTag)
Parses an existing section (read from a chunk's sections list)
Parameters
sectionTagNbtCompound
Throws
IllegalArgumentExceptionIf a palette and its data don't add up
public ChunkSection(NbtCompound sectionTag, BlockStateFormat format)
Parameters
sectionTagNbtCompound
formatBlockStateFormatHow new blocks get written, null to just copy whatever the palette does

Methods

public BlockStateFormat blockStateFormat()
Returns
BlockStateFormatHow new blocks get written into the palette
public static ChunkSection createEmpty(byte sectionY, String biome)
Builds a new, empty section at the given Y, with a single-block palette (air) and a single-entry biome palette (given biome), in the current block state format
Parameters
sectionYbyte
biomeString
Returns
ChunkSection
public static ChunkSection createEmpty(byte sectionY, String biome, BlockStateFormat format)
Parameters
sectionYbyte
biomeString
formatBlockStateFormatShould match the chunk's DataVersion, see BlockStateFormat.forDataVersion
Returns
ChunkSection
public String getBiome(int x, int y, int z)
Parameters
xint
yint
zint
Returns
String
public BlockState getBlock(int x, int y, int z)
Parameters
xint
yint
zint
Returns
BlockState
public String predominantBiome()
Returns
StringThe most common biome across this section's 4x4x4 biome grid. Returns null if this section has no biome data (should never happen for sections created via createEmpty, since those always get a biome).
public NbtCompound raw()
public byte sectionY()
Returns
byte
public void setBiome(int x, int y, int z, String biome)
Parameters
xint
yint
zint
biomeString
public void setBlock(int x, int y, int z, BlockState state)
Sets a block in this section and nothing else, Chunk.setBlock also cleans up after itself
Parameters
xint
yint
zint
stateBlockState

Used by

Methods of other types that accept or return ChunkSection.