[PR #1019] [MERGED] Carry: bare {min, max} number ranges in loot tables get 26.3's uniform type #2992

Closed
opened 2026-11-02 16:00:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1019
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: fix/carry-untyped-loot-numbers


📝 Commits (2)

  • f94dfe1 Carry: number providers written as a bare {min, max} get 26.3's uniform type
  • 621cea1 docs/modpacks.md: carry types bare number ranges

📊 Changes

2 files changed (+139 additions, -2 deletions)

View changed files

📝 crates/horizon-port-pack/src/carry.rs (+135 -1)
📝 docs/modpacks.md (+4 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

1.21.1 read a number provider written as a bare {"min": a, "max": b} (no type) as a uniform one: NumberProviders.CODEC fell back to UniformGenerator.CODEC. 26.3 dispatches on type alone (ContextIntProviders / ContextFloatProviders: an inline constant or a typed provider), so such a table no longer decodes, and the game's loot reader took those rolls and counts as 0.

Carry now gives them "type": "minecraft:uniform" while it upgrades a loot table:

  • pools: rolls, bonus_rolls;
  • the functions whose 1.21.1 codec reads a number provider: set_count / enchanted_count_increase (count), set_damage, enchant_with_levels, set_ominous_bottle_amplifier, set_stew_effect (each effect's duration), set_attributes (each modifier's amount), set_enchantments (each level), and limit_count's range bounds;
  • bounds nested inside a uniform or binomial provider (Structory's counts are ranges of ranges).

Ranges that are not number providers stay as they are: limit_count's limit itself, item predicates' counts in conditions.

Why

Found while re-carrying the shared ATM10 work folder (modpacks-11 brief, step 1): 304 of the 42 carried mods' loot tables have bare ranges (When Dungeons Arise 140, Repurposed Structures 50, Structory 36, Structory Towers 42, MVS 13, MSS 8, MNS 7, Towns and Towers 4, ...). Their chests came out empty or short.

How tested

cargo fmt --all -- --check                                  ok
cargo clippy --workspace --all-targets -- -D warnings       ok (integration commit: main + #969 #974 #975 #983 #984 #988 + this + the tags PR)
cargo test -p horizon-port-pack                             49 passed (new: carry::tests::types_bare_number_ranges)
tools/parity.py --changed origin/main                       0 harnesses depend on crates/horizon-port-pack

ATM10's 42 mods re-carried, seed 1234, chunks -32..31 in the Overworld and the Nether (chunkgen_bench with block entities, then loot_fill over every table the containers name, seeds 1..3):

before after
containers with a loot table 1,585 1,585
... whose table has a bare range 207 0
distinct tables named 106 106
tables that fill nothing 8 0
stacks filled (3 seeds) 2,848 3,139

The 8 that filled nothing: When Dungeons Arise's illager galley treasure and barrels, MNS's mega fortress chests (intact, intact base), MVS's general chest, Structory's fisherman, Structory Towers' fortress top, MSS's empty.

Needs Ludovic

Nothing.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1019 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/carry-untyped-loot-numbers` --- ### 📝 Commits (2) - [`f94dfe1`](https://github.com/horizon-rust/horizon/commit/f94dfe1f08406b05f28a2d99ba43e143f3949925) Carry: number providers written as a bare {min, max} get 26.3's uniform type - [`621cea1`](https://github.com/horizon-rust/horizon/commit/621cea18ca4560d28d80dc0285164b08ee3274a2) docs/modpacks.md: carry types bare number ranges ### 📊 Changes **2 files changed** (+139 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/carry.rs` (+135 -1) 📝 `docs/modpacks.md` (+4 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What 1.21.1 read a number provider written as a bare `{"min": a, "max": b}` (no `type`) as a uniform one: `NumberProviders.CODEC` fell back to `UniformGenerator.CODEC`. 26.3 dispatches on `type` alone (`ContextIntProviders` / `ContextFloatProviders`: an inline constant or a typed provider), so such a table no longer decodes, and the game's loot reader took those rolls and counts as 0. Carry now gives them `"type": "minecraft:uniform"` while it upgrades a loot table: - pools: `rolls`, `bonus_rolls`; - the functions whose 1.21.1 codec reads a number provider: `set_count` / `enchanted_count_increase` (`count`), `set_damage`, `enchant_with_levels`, `set_ominous_bottle_amplifier`, `set_stew_effect` (each effect's `duration`), `set_attributes` (each modifier's `amount`), `set_enchantments` (each level), and `limit_count`'s range bounds; - bounds nested inside a uniform or binomial provider (Structory's counts are ranges of ranges). Ranges that are not number providers stay as they are: `limit_count`'s `limit` itself, item predicates' counts in conditions. ## Why Found while re-carrying the shared ATM10 work folder (modpacks-11 brief, step 1): **304 of the 42 carried mods' loot tables** have bare ranges (When Dungeons Arise 140, Repurposed Structures 50, Structory 36, Structory Towers 42, MVS 13, MSS 8, MNS 7, Towns and Towers 4, ...). Their chests came out empty or short. ## How tested ``` cargo fmt --all -- --check ok cargo clippy --workspace --all-targets -- -D warnings ok (integration commit: main + #969 #974 #975 #983 #984 #988 + this + the tags PR) cargo test -p horizon-port-pack 49 passed (new: carry::tests::types_bare_number_ranges) tools/parity.py --changed origin/main 0 harnesses depend on crates/horizon-port-pack ``` ATM10's 42 mods re-carried, seed 1234, chunks -32..31 in the Overworld and the Nether (`chunkgen_bench` with block entities, then `loot_fill` over every table the containers name, seeds 1..3): | | before | after | |---|---:|---:| | containers with a loot table | 1,585 | 1,585 | | ... whose table has a bare range | 207 | 0 | | distinct tables named | 106 | 106 | | tables that fill nothing | 8 | 0 | | stacks filled (3 seeds) | 2,848 | 3,139 | The 8 that filled nothing: When Dungeons Arise's illager galley treasure and barrels, MNS's mega fortress chests (intact, intact base), MVS's general chest, Structory's fisherman, Structory Towers' fortress top, MSS's empty. ## Needs Ludovic Nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2992
No description provided.