world: place ruined portal pieces into the region replay

PlaceRuinedPortalPiece runs the template through the decoded processor
stack — positional Legacy streams per cell drive the gold-to-air,
lava-to-magma, netherrack-to-magma and block-age mossiness rolls, the
features-cannot-replace guard skips protected cells, and template lava
stays when it lands in existing lava. Drip columns below the portal
draw from a documented approximation of the shared decoration stream;
spreadNetherrack is not needed for the underground setups.

The placement chain is now proven end to end: chunk (1,0) reproduces
vanilla's saved start (portal_6, CLOCKWISE_90, NONE, air pocket at
(16,12,0)) and the fixture parity ticks up to 98.033% with biomes and
heightmaps still exact. generatorVersion bumps to 23.
This commit is contained in:
Daniar Mannanov 2026-08-26 15:26:42 +03:00
parent 0bb480279f
commit 120531c13d
10 changed files with 366 additions and 14 deletions

View file

@ -165,12 +165,12 @@ func TransformBlockPos(pos [3]int, mirror string, rotation int, pivot [3]int) [3
}
px, pz := pivot[0], pivot[2]
switch rotation {
case 1: // clockwise_90
return [3]int{px - pz + z, y, px + pz - x}
case 2: // clockwise_180
case 1: // clockwise_90 ($SwitchMap ordinal 1 -> bytecode target 172)
return [3]int{px + pz - z, y, pz - px + x}
case 3: // counterclockwise_90
case 2: // clockwise_180 (target 120)
return [3]int{px + px - x, y, pz + pz - z}
case 3: // counterclockwise_90 (target 146)
return [3]int{px - pz + z, y, px + pz - x}
}
return [3]int{x, y, z}
}