Skip to main content

Module jigsaw

Module jigsaw 

Source
Expand description

Jigsaw assembly. Ports vanilla’s JigsawPlacement BFS: connects pieces via jigsaw blocks given a start pool + config. Produces typed piece state; block placement runs in a later worldgen stage.

StructsΒ§

ActiveSourceJigsaw πŸ”’
Active source connector during jigsaw BFS.
AssemblyResult
Result of a successful jigsaw assembly.
AssemblyScratch πŸ”’
JigsawJunction
Junction between two jigsaw pieces (terrain adaptation).
JigsawPieceData
Typed state needed to place or compare a vanilla jigsaw piece.
JigsawStructure
Registered under minecraft:jigsaw for pool-based structures such as villages, bastions, ancient cities, and trail ruins.
PieceQueueEntry πŸ”’
BFS queue entry ordered by descending placement_priority, FIFO within ties.
PlacedPiece
A placed piece produced by jigsaw assembly.
StartedAssembly πŸ”’
TransformedJigsaw πŸ”’
A jigsaw block with its position transformed by rotation.

EnumsΒ§

FreeSpace πŸ”’
Free-space tracker. Small contexts use a flat list; larger contexts switch to BoxOctree for nearby-box queries.
PieceQueue πŸ”’

ConstantsΒ§

CANDIDATE_DEDUPE_THRESHOLD πŸ”’
FREE_SPACE_OCTREE_THRESHOLD πŸ”’
JIGSAW_PRIORITY_CACHE_THRESHOLD πŸ”’
QUEUE_HEAP_THRESHOLD πŸ”’

StaticsΒ§

SYNTHETIC_BOTTOM_JIGSAW πŸ”’
SYNTHETIC_EMPTY_POOL πŸ”’

FunctionsΒ§

append_shuffled_templates_cached πŸ”’
Appends vanilla’s StructureTemplatePool.getShuffledTemplates to out.
assemble
Vanilla’s JigsawPlacement.addPieces. Returns None on failure (empty start pool, dimension padding violation, etc.).
cached_descending_priorities πŸ”’
cached_pool_max_y_size πŸ”’
cached_runtime_rotated_jigsaws πŸ”’
candidate_bounding_box_at_origin πŸ”’
descending_priorities πŸ”’
descending_priorities_into πŸ”’
element_bounding_box πŸ”’
Gets the bounding box for a pool element at a position with rotation.
element_location πŸ”’
Gets the template location from a pool element.
expand_pool_weights πŸ”’
feature_synthetic_jigsaw πŸ”’
finish_assembly πŸ”’
get_random_template πŸ”’
Vanilla’s StructureTemplatePool.getRandomTemplate.
java_center πŸ”’
Java integer midpoint used by vanilla jigsaw placement: (min + max) / 2.
order_jigsaw_indices_by_priorities πŸ”’
pool_max_y_size πŸ”’
Vanilla’s StructureTemplatePool.getMaxSize β€” max Y span across all templates.
prime_duplicate_candidate_rng πŸ”’
Consumes the same RNG draws as a failed placement attempt for a duplicate pool element.
resolve_aliases
Resolves pool aliases for a specific structure instance.
rotation_index πŸ”’
sample_start_height πŸ”’
shuffle_jigsaw_indices_into πŸ”’
shuffle_jigsaw_indices_with_priority_cache πŸ”’
shuffled_element_jigsaws πŸ”’
start_assembly πŸ”’
Vanilla’s JigsawPlacement.addPieces before the lazy GenerationStub child builder.
transform_template_jigsaws πŸ”’
try_placing_children πŸ”’
Vanilla’s tryPlacingChildren. context_idx is this piece’s collision context in free_spaces β€” external children get the parent’s context, internal children get the parent’s internal free space.
vanilla_shuffle πŸ”’
Vanilla-matching shuffle (reverse Fisher-Yates).

Type AliasesΒ§

JigsawRotationCache πŸ”’
PoolTemplateCache πŸ”’