Expand description
World-carving: runtime context + carver implementations.
World-carving: runtime types for running configured carvers during the
CARVERS chunk stage.
Mirrors vanilla’s net.minecraft.world.level.levelgen.carver package. The
[CarvingContext] bundles the dimension-level state; a [CarveRun]
bundles the per-chunk references that every carver method threads
through.
Modules§
- canyon
- Canyon (ravine) carver.
- cave
- Cave carver (overworld + nether variants).
- mask 🔒
- Per-chunk bitset marking which block positions have already been visited by a carver.
Structs§
- Carve
Params - Per-carver parameters: the replaceable-tag, resolved lava level, and
which carver style to dispatch. Block IDs live on
CarveRunbecause they’re shared across all carvers in a chunk. - Carve
Run - The references every carver method needs. Bundled so
carve_ellipsoid,carve_block,create_tunnel,create_room,carve_cave,carve_canyon, anddo_carvecan all be&mut selfmethods instead of repeating the same 7–8 arguments. - Carver
Block Ids - Well-known block state IDs a carver needs. Cached once per
apply_carverscall so the carver loop doesn’t hit the registry in its hot path. - Carver
Replaceable States - Per-state membership cache for a carver’s replaceable block tag.
- Carving
Context - Runtime context for a single
apply_carversinvocation on one chunk. - Carving
Mask - A
16 × height × 16bitset of local block positions in a chunk. - Preliminary
Surface Corners - The four preliminary-surface-level samples at a chunk’s block corners, in
world Y. Indexed by local
(x, z)corner as(0,0),(16,0),(0,16),(16,16). - Source
Chunk - A source chunk’s position and carver-list biome — the unit of work in the
17×17
apply_carversloop. Each entry feeds one or more carver invocations from the biome’scarverslist.
Enums§
- Carve
State 🔒 - Decision returned by the per-block carve-state computation.
- Carver
Style - Which carver family dictates the per-block decision inside
CarveRun::carve_ellipsoid. Overworld carvers (cave + canyon) use the aquifer to pick air / water / lava; the nether variant hardcodes lava belowmin_gen_y + 31and cave-air elsewhere, with no aquifer lookups.
Statics§
Traits§
- Carve
Skip Checker - Predicate called inside the carver’s Y scan to decide whether a block is
outside the carved shape for a given ellipsoid (cave floor cutoff, canyon
width-by-height, etc). Matches vanilla’s
WorldCarver.CarveSkipChecker.
Functions§
- cached_
replaceable_ states - Returns the cached replaceable-state set for a configured carver tag.
- can_
reach - Vanilla’s
WorldCarver.canReach— prunes carver steps that can’t touch any block in the given chunk (used by cave/canyon tunnel loops before carving an ellipsoid). - can_
replace_ block - Vanilla’s
WorldCarver.canReplaceBlock: a carver may only replace blocks in its config’sreplaceabletag. - horizontal_
tunnel_ 🔒radius - Vanilla cave/canyon tunnel radius calculation.
- steep_
material_ 🔒condition - Vanilla’s
SurfaceRules.steep()condition. It is asymmetric: only south-vs-north and west-vs-east deltas are checked.