[PR #3742] [MERGED] Port pack: items of vanilla tool and armour classes keep their stats #5187

Closed
opened 2026-11-03 05:10:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3742
Author: @UMCEKO
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: mods/port-item-stats


📝 Commits (6)

  • f904f44 Mod port harness: compare items' stats with the NeoForge oracle
  • d39715c Port pack: items of vanilla tool and armour classes keep their stats
  • fd41f0e Merge main into mods/harness-item-components
  • 5d7c622 Merge main into mods/port-item-stats
  • a502ecc Mod port harness: drop 1.21.1's player. attribute prefix too
  • 18a900a Merge mods/harness-item-components into mods/port-item-stats

📊 Changes

5 files changed (+278 additions, -8 deletions)

View changed files

📝 crates/horizon-client/examples/mod_port_probe.rs (+31 -1)
📝 crates/horizon-port-pack/src/oracle.rs (+191 -3)
📝 crates/horizon-port-pack/src/pipeline.rs (+4 -1)
📝 docs/modpacks.md (+5 -1)
📝 tools/mod_port_harness.py (+47 -2)

📄 Description

🤖 Opened by UMCEKO's AI agent (Claude Code), not by UMCEKO.

Stack, part 4 of 7. The PRs come from a fork, so each one targets main and contains the ones before it. Please merge them in order; this PR's own change is its last commit.

  1. #3739
  2. #3740
  3. #3741
    → 4. #3742
  4. #3743
  5. #3744
  6. #3745

What and why

With the oracle's facts, every ported item came over as a stick: a sword had no damage, no durability and no mining rules. An item of a vanilla tool or armour class (SwordItem, PickaxeItem, AxeItem, ShovelItem, HoeItem, ArmorItem by slot) now gets the iron item of its class as template. It also gets the oracle's durability, attribute modifiers (ids upgraded), tool rules, enchantability and repair items as a component patch (#3739), minus what the template already has; --resources provides the template's components.

  • The mod's tool rules replace the template's entirely, because a tier names its own incorrect-for-drops tag (#simplest_emerald_gear:incorrect_for_emerald_tool). Merging rules by block set would have kept iron's limit.
  • What 1.21.1 kept in the class stays the template's: a sword sparing blocks in creative (can_destroy_blocks_in_creative).
  • Other items keep minecraft:stick; food is still refused, as before.

Against the mod on NeoForge:

before after
harness item_stats 4/49 64/64
emerald sword tooltip name only 6.5 Attack Damage, 1.6 Attack Speed
one hit on a NoAI pig (10 health) 3.5 left (NeoForge: 6.5 damage; iron sword: 4.0 left)
armour bar with the full set none 17, toughness 4 (NeoForge's sums)

Vanilla reference

Horizon-only (port tooling). The templates are vanilla's iron items, and the numbers come from the oracle (#3740).

Self-check

pr_ready (tools/pr_ready.py --quick --base mods/harness-item-components on nixos, against mods/harness-item-components at f904f4404, 1 min 5 s)

Check Result
Scope ✅ 3 files, +200 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (29 s)
rustfmt ✅ (7 s)
clippy ✅ (2 s)
tests: horizon-port-pack ✅ 69 passed (7 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (5 s)
launcher tests ✅ 268 passed (13 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

The "after" shots were taken with the whole stack; the tooltip and the armour bar come from this PR (worn armour still draws as iron until #3744).

before (main) after

Tools used

  • headless-computer-mcp (UMCEKO's): runs the game in a private headless Wayland compositor and drives it with a real mouse and keyboard; every screenshot in this stack was taken with it, including the hovered tooltips.
  • tools/neoforge_oracle.py: the real mod jar on NeoForge 21.1.259, the ground truth (extended in this stack to export item components).
  • horizon-port-pack carry with --resources, then tools/mod_port_harness.py with examples/mod_port_probe.rs (extended in this stack to compare item stats and worn armour).
  • horizon-ctl against the real game: /give, /item replace, /attribute and a hit on a NoAI pig.
  • tools/pr_ready.py --quick, run against the PR before this one so the block covers this PR alone.

The test mod is Simplest Emerald Gear 1.0.6 for NeoForge 1.21.1 (MIT): 9 items, no dependencies. Its jar, the oracle facts and the carry stayed on the local machine, outside the repository.

🤖 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/3742 **Author:** [@UMCEKO](https://github.com/UMCEKO) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `mods/port-item-stats` --- ### 📝 Commits (6) - [`f904f44`](https://github.com/horizon-rust/horizon/commit/f904f4404751d355b00787fe5edd170da82c71c4) Mod port harness: compare items' stats with the NeoForge oracle - [`d39715c`](https://github.com/horizon-rust/horizon/commit/d39715cca0db7637598449a67deb57cdcc6d9362) Port pack: items of vanilla tool and armour classes keep their stats - [`fd41f0e`](https://github.com/horizon-rust/horizon/commit/fd41f0e36f278eccde06c63a6c4948865184b08a) Merge main into mods/harness-item-components - [`5d7c622`](https://github.com/horizon-rust/horizon/commit/5d7c622895b5c59f8a54e7bbede9daeca27059a2) Merge main into mods/port-item-stats - [`a502ecc`](https://github.com/horizon-rust/horizon/commit/a502eccc921cb7a799fb47f5ebcbe71ffbd86226) Mod port harness: drop 1.21.1's player. attribute prefix too - [`18a900a`](https://github.com/horizon-rust/horizon/commit/18a900a36061ba271c8a8db266667423a2bb526d) Merge mods/harness-item-components into mods/port-item-stats ### 📊 Changes **5 files changed** (+278 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/mod_port_probe.rs` (+31 -1) 📝 `crates/horizon-port-pack/src/oracle.rs` (+191 -3) 📝 `crates/horizon-port-pack/src/pipeline.rs` (+4 -1) 📝 `docs/modpacks.md` (+5 -1) 📝 `tools/mod_port_harness.py` (+47 -2) </details> ### 📄 Description > 🤖 Opened by UMCEKO's AI agent (Claude Code), not by UMCEKO. **Stack, part 4 of 7.** The PRs come from a fork, so each one targets `main` and contains the ones before it. Please merge them in order; this PR's own change is its last commit. 1. #3739 2. #3740 3. #3741 **→** 4. #3742 5. #3743 6. #3744 7. #3745 ## What and why With the oracle's facts, every ported item came over as a stick: a sword had no damage, no durability and no mining rules. An item of a vanilla tool or armour class (`SwordItem`, `PickaxeItem`, `AxeItem`, `ShovelItem`, `HoeItem`, `ArmorItem` by slot) now gets the iron item of its class as template. It also gets the oracle's durability, attribute modifiers (ids upgraded), tool rules, enchantability and repair items as a component patch (#3739), minus what the template already has; `--resources` provides the template's components. - The mod's tool rules replace the template's entirely, because a tier names its own incorrect-for-drops tag (`#simplest_emerald_gear:incorrect_for_emerald_tool`). Merging rules by block set would have kept iron's limit. - What 1.21.1 kept in the class stays the template's: a sword sparing blocks in creative (`can_destroy_blocks_in_creative`). - Other items keep `minecraft:stick`; food is still refused, as before. Against the mod on NeoForge: | | before | after | |---|---|---| | harness `item_stats` | 4/49 | 64/64 | | emerald sword tooltip | name only | 6.5 Attack Damage, 1.6 Attack Speed | | one hit on a NoAI pig (10 health) | | 3.5 left (NeoForge: 6.5 damage; iron sword: 4.0 left) | | armour bar with the full set | none | 17, toughness 4 (NeoForge's sums) | ## Vanilla reference Horizon-only (port tooling). The templates are vanilla's iron items, and the numbers come from the oracle (#3740). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base mods/harness-item-components` on nixos, against mods/harness-item-components at f904f4404, 1 min 5 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +200 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (29 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (2 s) | | tests: horizon-port-pack | ✅ 69 passed (7 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (5 s) | | launcher tests | ✅ 268 passed (13 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots The "after" shots were taken with the whole stack; the tooltip and the armour bar come from this PR (worn armour still draws as iron until #3744). | before (`main`) | after | |---|---| | ![](https://raw.githubusercontent.com/UMCEKO/horizon/pr-screenshots/main-sword-tooltip.png) | ![](https://raw.githubusercontent.com/UMCEKO/horizon/pr-screenshots/after-sword-tooltip.png) | | ![](https://raw.githubusercontent.com/UMCEKO/horizon/pr-screenshots/main-hud.png) | ![](https://raw.githubusercontent.com/UMCEKO/horizon/pr-screenshots/after-hud.png) | ![](https://raw.githubusercontent.com/UMCEKO/horizon/pr-screenshots/after-chestplate-tooltip.png) ## Tools used - [headless-computer-mcp](https://github.com/UMCEKO/headless-computer-mcp) (UMCEKO's): runs the game in a private headless Wayland compositor and drives it with a real mouse and keyboard; every screenshot in this stack was taken with it, including the hovered tooltips. - `tools/neoforge_oracle.py`: the real mod jar on NeoForge 21.1.259, the ground truth (extended in this stack to export item components). - `horizon-port-pack carry` with `--resources`, then `tools/mod_port_harness.py` with `examples/mod_port_probe.rs` (extended in this stack to compare item stats and worn armour). - `horizon-ctl` against the real game: `/give`, `/item replace`, `/attribute` and a hit on a NoAI pig. - `tools/pr_ready.py --quick`, run against the PR before this one so the block covers this PR alone. The test mod is [Simplest Emerald Gear](https://modrinth.com/mod/simplest-emerald-gear) 1.0.6 for NeoForge 1.21.1 (MIT): 9 items, no dependencies. Its jar, the oracle facts and the carry stayed on the local machine, outside the repository. 🤖 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-03 05:10:49 +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#5187
No description provided.