Skip to main content

Module carver

Module carver 

Source
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§

CarveParams
Per-carver parameters: the replaceable-tag, resolved lava level, and which carver style to dispatch. Block IDs live on CarveRun because they’re shared across all carvers in a chunk.
CarveRun
The references every carver method needs. Bundled so carve_ellipsoid, carve_block, create_tunnel, create_room, carve_cave, carve_canyon, and do_carve can all be &mut self methods instead of repeating the same 7–8 arguments.
CarverBlockIds
Well-known block state IDs a carver needs. Cached once per apply_carvers call so the carver loop doesn’t hit the registry in its hot path.
CarverReplaceableStates
Per-state membership cache for a carver’s replaceable block tag.
CarvingContext
Runtime context for a single apply_carvers invocation on one chunk.
CarvingMask
A 16 × height × 16 bitset of local block positions in a chunk.
PreliminarySurfaceCorners
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).
SourceChunk
A source chunk’s position and carver-list biome — the unit of work in the 17×17 apply_carvers loop. Each entry feeds one or more carver invocations from the biome’s carvers list.

Enums§

CarveState 🔒
Decision returned by the per-block carve-state computation.
CarverStyle
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 below min_gen_y + 31 and cave-air elsewhere, with no aquifer lookups.

Statics§

CARVER_REPLACEABLE_STATES 🔒

Traits§

CarveSkipChecker
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’s replaceable tag.
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.