[PR #3740] [MERGED] NeoForge oracle: export items' data components and armour facts #5184

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

📋 Pull Request Information

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

Base: main ← Head: mods/oracle-item-components


📝 Commits (2)

  • 5c66b27 Content mods: items patch their template's data components
  • df96b67 NeoForge oracle: export items' data components and armour facts

📊 Changes

7 files changed (+280 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+51 -4)
📝 crates/horizon-client/src/mod_content_tests.rs (+49 -1)
📝 crates/horizon-mods/src/content.rs (+83 -1)
📝 docs/modpacks.md (+5 -2)
📝 docs/mods.md (+21 -0)
📝 mods/horizon/src/neoforge-oracle/java/dev/horizonlab/neoforge/FactsExporter.java (+70 -0)
📝 tools/neoforge_oracle.py (+1 -0)

📄 Description

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

Stack, part 2 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
  2. #3741
  3. #3742
  4. #3743
  5. #3744
  6. #3745

What and why

The oracle exported an item's class, stack size, rarity and food only, so nothing could check a ported item's stats. Each item now also carries:

  • its default data components, encoded with vanilla's own codecs (1.21.1's form);
  • its effective attribute modifiers: 1.21.1 armour supplies them from ArmorItem.getDefaultAttributeModifiers, not from a component;
  • its enchantability and repair items, which 1.21.1 keeps on the tier or material;
  • for armour: slot, material, defense, toughness, knockback resistance, equip sound and texture layers.

This also fixes neoforge_oracle.py export, which failed when the --out folder didn't exist yet (the exporter crashed with NoSuchFileException).

On Simplest Emerald Gear, the emerald sword now exports 905 durability, +5.5 attack damage, -2.4 attack speed, sword tool rules, enchantability 10 and emerald repair. The port-pack reader ignores fields it doesn't know, so nothing downstream changes.

Vanilla reference

None (dev tool). The values are read from the running 1.21.1 server: TypedDataComponent.encodeValue, ItemAttributeModifiers.CODEC, TieredItem.getTier, ArmorItem/ArmorMaterial.

Self-check

pr_ready (tools/pr_ready.py --quick --base mods/item-components on nixos, against mods/item-components at 5c66b27c9, 31 s)

Check Result
Scope ✅ 3 files, +74 −1
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 416 passed (30 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label skip-release

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/3740 **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/oracle-item-components` --- ### 📝 Commits (2) - [`5c66b27`](https://github.com/horizon-rust/horizon/commit/5c66b27c9a8f4e98496b51c7b8f8d44e71b24f54) Content mods: items patch their template's data components - [`df96b67`](https://github.com/horizon-rust/horizon/commit/df96b6787d86b6a1dac90327bef36dd9e221263b) NeoForge oracle: export items' data components and armour facts ### 📊 Changes **7 files changed** (+280 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+51 -4) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+49 -1) 📝 `crates/horizon-mods/src/content.rs` (+83 -1) 📝 `docs/modpacks.md` (+5 -2) 📝 `docs/mods.md` (+21 -0) 📝 `mods/horizon/src/neoforge-oracle/java/dev/horizonlab/neoforge/FactsExporter.java` (+70 -0) 📝 `tools/neoforge_oracle.py` (+1 -0) </details> ### 📄 Description > 🤖 Opened by UMCEKO's AI agent (Claude Code), not by UMCEKO. **Stack, part 2 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 The oracle exported an item's class, stack size, rarity and food only, so nothing could check a ported item's stats. Each item now also carries: - its default data components, encoded with vanilla's own codecs (1.21.1's form); - its effective attribute modifiers: 1.21.1 armour supplies them from `ArmorItem.getDefaultAttributeModifiers`, not from a component; - its enchantability and repair items, which 1.21.1 keeps on the tier or material; - for armour: slot, material, defense, toughness, knockback resistance, equip sound and texture layers. This also fixes `neoforge_oracle.py export`, which failed when the `--out` folder didn't exist yet (the exporter crashed with `NoSuchFileException`). On Simplest Emerald Gear, the emerald sword now exports 905 durability, +5.5 attack damage, -2.4 attack speed, sword tool rules, enchantability 10 and emerald repair. The port-pack reader ignores fields it doesn't know, so nothing downstream changes. ## Vanilla reference None (dev tool). The values are read from the running 1.21.1 server: `TypedDataComponent.encodeValue`, `ItemAttributeModifiers.CODEC`, `TieredItem.getTier`, `ArmorItem`/`ArmorMaterial`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base mods/item-components` on nixos, against mods/item-components at 5c66b27c9, 31 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +74 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 416 passed (30 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | `skip-release` | ## 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:48 +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#5184
No description provided.