public class ChunkConstructors
public Chunk(NbtCompound root)Wraps a chunk's NBT as it comes out of a region file
| Parameters | ||
|---|---|---|
root | NbtCompound | |
| Throws | ||
IllegalArgumentException | If a section's palette and data don't add up | |
Methods
BlockStateFormat blockStateFormat()int chunkX()int chunkZ()ChunkSection createSection(int, String)Creates a new, empty (air) section at the given Y.Set<Integer> editedSections()BlockState getBlock(int, int, int)NbtCompound raw()void setBlock(int, int, int, BlockState)Sets a block and automatically creates the target section
(as air, with a resolved biome) if it doesn't exist yet
Light and heightmaps get thrown out, Minecraft redoes them on load.public BlockStateFormat blockStateFormat()| Returns | ||
|---|---|---|
BlockStateFormat | How this chunk's palettes store blocks | |
public int chunkX()| Returns | ||
|---|---|---|
int | ||
public int chunkZ()| Returns | ||
|---|---|---|
int | ||
public ChunkSection createSection(int sectionY, String biome)Creates a new, empty (air) section at the given Y.
| Parameters | ||
|---|---|---|
sectionY | int | |
biome | String | The biome to fill the new section with. If null, it looks at the
section(s) directly above/below within this chunk, if both exist, their
predominant biomes (calculated via ChunkSection.predominantBiome
are tallied together and the overall most common one gets used;
if only one exists, its predominant biome is used. If neither
immediate neighbor exists, this searches outward for the nearest existing
section in either direction. If this chunk has no sections at all yet,
it falls back to "minecraft:plains". |
| Returns | ||
ChunkSection | ||
| Throws | ||
IllegalStateException | If a section already exists at this Y | |
public Set<Integer> editedSections()public BlockState getBlock(int x, int y, int z)| Parameters | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
| Returns | ||
BlockState | ||
public NbtCompound raw()| Returns | ||
|---|---|---|
NbtCompound | ||
public void setBlock(int x, int y, int z, BlockState state)Sets a block and automatically creates the target section
(as air, with a resolved biome) if it doesn't exist yet
Light and heightmaps get thrown out, Minecraft redoes them on load. A chest that turns into stone takes its
items with it, a chest you place gets no block entity though, the game makes one once it needs it
| Parameters | ||
|---|---|---|
x | int | |
y | int | |
z | int | |
state | BlockState | |
Used by
Methods of other types that accept or return Chunk.