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Β§
- Active
Source πJigsaw - Active source connector during jigsaw BFS.
- Assembly
Result - Result of a successful jigsaw assembly.
- Assembly
Scratch π - Jigsaw
Junction - Junction between two jigsaw pieces (terrain adaptation).
- Jigsaw
Piece Data - Typed state needed to place or compare a vanilla jigsaw piece.
- Jigsaw
Structure - Registered under
minecraft:jigsawfor pool-based structures such as villages, bastions, ancient cities, and trail ruins. - Piece
Queue πEntry - BFS queue entry ordered by descending
placement_priority, FIFO within ties. - Placed
Piece - A placed piece produced by jigsaw assembly.
- Started
Assembly π - Transformed
Jigsaw π - A jigsaw block with its position transformed by rotation.
EnumsΒ§
- Free
Space π - Free-space tracker. Small contexts use a flat list; larger contexts switch
to
BoxOctreefor nearby-box queries. - Piece
Queue π
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.getShuffledTemplatestoout. - assemble
- Vanillaβs
JigsawPlacement.addPieces. ReturnsNoneon 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.addPiecesbefore the lazyGenerationStubchild builder. - transform_
template_ πjigsaws - try_
placing_ πchildren - Vanillaβs
tryPlacingChildren.context_idxis this pieceβs collision context infree_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Β§
- Jigsaw
Rotation πCache - Pool
Template πCache