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.
- mask 🔒
- Per-chunk bitset marking which block positions have already been visited by a carver.
Structs§
- 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
UNCARVABLE_TAG, resolved once into a state-id table to avoid repeated tag lookups in the carve loop. - 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.
Constants§
- UNCARVABLE_
TAG - Vanilla’s global
#minecraft:uncarvableblock tag (applyCarvingMask’s!blockState.is(BlockTags.UNCARVABLE)check). Every carver shares this one tag now, not a per-carver one.
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§
- 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 - A block may be carved unless it’s in
#minecraft:uncarvable. No separate air check — air isn’t in the tag, so it’s replaced like anything else. - 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.