// generated by diplomat-tool import type { NucleationError } from "./NucleationError.mjs" import type { Schematic } from "./Schematic.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * A single decoded chunk (or a from-scratch chunk under construction). */ export class WorldChunkView { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Create an empty chunk view at the given chunk coordinates — the * starting point for generating worlds from scratch. Sections are * created on demand by `set_block`. Serialized with * `status = "minecraft:full"` (Minecraft will not regenerate over it) * and the default data version. */ static create(cx: number, cz: number): WorldChunkView; /** * The chunk X coordinate (in chunk units). */ cx(): number; /** * The chunk Z coordinate (in chunk units). */ cz(): number; /** * Convert the chunk view to a standalone schematic. */ toSchematic(): Schematic; /** * Build a chunk view at (`cx`, `cz`) from a schematic — every non-air * block whose world (x, z) falls in this chunk is copied in, the rest * ignored. The write-side twin of `to_schematic`: this is how the * schematic building tools become a *world generator*. Fill a schematic * with any shape, SDF, brush, or footprint (intersect it with the * chunk's cuboid to keep memory flat), then hand it here per chunk and * `WorldSink.write_chunk` it. Also the transform step of a world filter: * `to_schematic` a streamed chunk, edit it, rebuild with this. */ static fromSchematic(schematic: Schematic, cx: number, cz: number): WorldChunkView; /** * Set a block at absolute world coordinates inside this chunk view. * `block_name` must be a valid Minecraft block identifier (e.g. * `minecraft:stone`). Errors with `InvalidArgument` if (x, z) is outside * this chunk's column. */ setBlock(x: number, y: number, z: number, blockName: string): void; /** * Overwrite the biome of every currently-present section of the chunk * view with `biome_name` (e.g. `minecraft:desert`). Sections are created * lazily by `set_block`, so call this AFTER placing blocks. */ setBiome(biomeName: string): void; /** * Deduped union of all sections' biome palette entries, in order of * first appearance, written as a JSON array string (`[]` if no section * carries biome data). */ biomePaletteJson(): string; }