minified-worlds/com.dervarex.minified.worlds.chunk
ChunkSection
public class ChunkSectionA 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 | ||
|---|---|---|
sectionTag | NbtCompound | |
| Throws | ||
IllegalArgumentException | If a palette and its data don't add up | |
public ChunkSection(NbtCompound sectionTag, BlockStateFormat format)| Parameters | ||
|---|---|---|
sectionTag | NbtCompound | |
format | BlockStateFormat | How new blocks get written, null to just copy whatever the palette does |
Methods
BlockStateFormat blockStateFormat()ChunkSection createEmpty(byte, String)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 formatChunkSection createEmpty(byte, String, BlockStateFormat)Like createEmpty(byte, String)String getBiome(int, int, int)BlockState getBlock(int, int, int)String predominantBiome()NbtCompound raw()byte sectionY()void setBiome(int, int, int, String)void setBlock(int, int, int, BlockState)Sets a block in this section and nothing else, Chunk.setBlock also cleans up after itselfpublic BlockStateFormat blockStateFormat()| Returns | ||
|---|---|---|
BlockStateFormat | How 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 | ||
|---|---|---|
sectionY | byte | |
biome | String | |
| Returns | ||
ChunkSection | ||
public static ChunkSection createEmpty(byte sectionY, String biome, BlockStateFormat format)| Parameters | ||
|---|---|---|
sectionY | byte | |
biome | String | |
format | BlockStateFormat | Should match the chunk's DataVersion, see BlockStateFormat.forDataVersion |
| Returns | ||
ChunkSection | ||
public String getBiome(int x, int y, int z)| Parameters | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
| Returns | ||
String | ||
public BlockState getBlock(int x, int y, int z)| Parameters | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
| Returns | ||
BlockState | ||
public String predominantBiome()| Returns | ||
|---|---|---|
String | The 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()| Returns | ||
|---|---|---|
NbtCompound | ||
public byte sectionY()| Returns | ||
|---|---|---|
byte | ||
public void setBiome(int x, int y, int z, String biome)| Parameters | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
biome | String | |
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 | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
state | BlockState | |
Used by
Methods of other types that accept or return ChunkSection.