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.
mask 🔒
Per-chunk bitset marking which block positions have already been visited by a carver.

Structs§

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 UNCARVABLE_TAG, resolved once into a state-id table to avoid repeated tag lookups in the carve loop.
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.

Constants§

UNCARVABLE_TAG
Vanilla’s global #minecraft:uncarvable block tag (applyCarvingMask’s !blockState.is(BlockTags.UNCARVABLE) check). Every carver shares this one tag now, not a per-carver one.

Statics§

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

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.