From 1e800099e96a1a8f288e8e9a99bd6178810a2cab Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:18:34 +0200 Subject: [PATCH] Carry: vertical_distance_from_start_piece is a dead field, not a lost rule Repurposed Structures' jungle fortress and End stronghold still write vertical_distance_from_start_piece, but no codec of the mod (or of Moog's Structure Lib) reads it any more: its own structures ignore it. Carry drops it without counting it in rules_lost, which now lists only rules the mods do run. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-port-pack/src/worldgen.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/horizon-port-pack/src/worldgen.rs b/crates/horizon-port-pack/src/worldgen.rs index 7de9f39ce..a10503164 100644 --- a/crates/horizon-port-pack/src/worldgen.rs +++ b/crates/horizon-port-pack/src/worldgen.rs @@ -94,14 +94,17 @@ const START_RULES: [(&str, &str); 3] = [ ]; /// The jigsaws' rules on laying out pieces, which vanilla's jigsaw has no /// place for. -const LAYOUT_RULES: [&str; 6] = [ +const LAYOUT_RULES: [&str; 5] = [ "y_allowance", "burying_type", "use_bounding_box_hack", "pools_that_ignore_boundaries", "enhanced_terrain_adaptation", - "vertical_distance_from_start_piece", ]; +/// Fields of older versions the mods' codecs no longer read: their own +/// structures ignore them, and so does carry. Repurposed's jungle fortress +/// and End stronghold still write `vertical_distance_from_start_piece`. +const DEAD_FIELDS: [&str; 1] = ["vertical_distance_from_start_piece"]; /// Pool elements that are vanilla's with extra fields: (mod type, vanilla type). const ELEMENTS: [(&str, &str); 3] = [ ( @@ -646,6 +649,9 @@ fn start_checks(v: &mut Value, liquid: &str, lost: &mut BTreeMap, checks.insert(to.into(), n.clone()); } } + for field in DEAD_FIELDS { + o.remove(field); + } for rule in LAYOUT_RULES { let kept = limited && PIECE_LIMITED_RULES.contains(&rule); if o.remove(rule).is_some_and(|r| r != Value::Bool(false)) && !kept { @@ -1101,11 +1107,13 @@ mod tests { assert!(moogs.get(gone).is_none(), "{gone}"); } assert_eq!(moogs["size"], 7); - // Repurposed Structures reads the block above the bottom. + // Repurposed Structures reads the block above the bottom. Its jungle + // fortress's vertical distance is a field its code no longer reads. let mut rs = json!({"type": "repurposed_structures:generic_jigsaw_structure", - "cannot_spawn_in_liquid": true}); + "cannot_spawn_in_liquid": true, "vertical_distance_from_start_piece": 35}); assert!(upgrade("structure", &mut rs, &mut report, &NO_TAGS)); assert_eq!(rs["horizon:start_checks"], json!({"liquid": "lowest"})); + assert!(rs.get("vertical_distance_from_start_piece").is_none()); // Repurposed's own checks: the Nether city, Nether shipwrecks, the End stronghold. for (t, check) in [ ("city_nether_structure", "city_nether"),