[PR #6347] [MERGED] feat(mods): add experience pickup and mending hooks #6815

Closed
opened 2026-11-03 06:27:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6347
Author: @loicpiller
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/6084


📝 Commits (5)

  • 2dde8af feat(mods): add experience pickup and mending hooks
  • 6286215 fix(mods): guard reentrant mending and bound orb experience
  • a15fb72 fix(mods): revalidate mending before zero repair
  • 5327c34 Native hooks: XP pickup and Mending as a hook fragment, pickup gated on a listener
  • 23e3ae4 Native hooks: the XP pickup and Mending hooks as a fragment, pickup gated on a listener

📊 Changes

4 files changed (+122 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/game/enchant_effects.rs (+29 -7)
📝 crates/horizon-client/src/game/lan_actions.rs (+32 -4)
📝 crates/horizon-client/src/game/native_hooks.rs (+38 -0)
➕ tools/native-hook-fragments/experience_orb_pickup.json (+23 -0)

📄 Description

🤖 Opened by loicpiller's AI agent (Codex, GPT-6.1-Terra), not by loicpiller personally.

What and why

Add native API 81 hooks for experience orb pickup and Mending repair. Mods can cancel pickup or change orb value/count, and change the repair proposed for the selected item. The hooks run on integrated and dedicated servers, including guests; native_give_experience also runs Mending. Orb values are bounded to 1..=i32::MAX. Mending revalidates the selected slot after the hook, including before a vanilla zero proposal, and uses current damage after reentrant changes. Turning a positive repair proposal into zero returns the XP unspent. A replacement stack identical in content to the original cannot be distinguished from it.

Fixes #6084

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only native mod hooks around existing XP pickup and Mending behavior. The targeted fixtures extract the implementation and simulate hooks; they do not run a real server with a loaded mod.

Other projects' code

None.

Self-check

  • After rebase: seven targeted fixture scenarios, cargo check -p horizon-client --bin horizon-client, and python3 tools/check_public_tree.py --history passed in the offline devshell. API 81 and both catalog entries checked against current main; no collision.
  • Before rebase: pr_ready.py --quick passed public tree, Python tests, rustfmt and Clippy; its horizon-client test phase was interrupted after 22 minutes, so there is no overall verdict. The targeted bin check passed. Parity was not completed (322 of 382 harnesses selected; jobs stopped).
  • No real server with a loaded mod was tested. CI and a full self-check remain needed.

🤖 Generated with Codex


🔄 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/6347 **Author:** [@loicpiller](https://github.com/loicpiller) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6084` --- ### 📝 Commits (5) - [`2dde8af`](https://github.com/horizon-rust/horizon/commit/2dde8afb43469da70e69edb9c25d80659a87f3f6) feat(mods): add experience pickup and mending hooks - [`6286215`](https://github.com/horizon-rust/horizon/commit/6286215b22989c6bb9baa054d10ac53f3b13198a) fix(mods): guard reentrant mending and bound orb experience - [`a15fb72`](https://github.com/horizon-rust/horizon/commit/a15fb72e184b6e9169af0137f5941eea9f8abfc8) fix(mods): revalidate mending before zero repair - [`5327c34`](https://github.com/horizon-rust/horizon/commit/5327c34478d53428eeb450a485af4ac8487469d2) Native hooks: XP pickup and Mending as a hook fragment, pickup gated on a listener - [`23e3ae4`](https://github.com/horizon-rust/horizon/commit/23e3ae415e80b802d55597408ab3e4321d906fbc) Native hooks: the XP pickup and Mending hooks as a fragment, pickup gated on a listener ### 📊 Changes **4 files changed** (+122 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/enchant_effects.rs` (+29 -7) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+32 -4) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+38 -0) ➕ `tools/native-hook-fragments/experience_orb_pickup.json` (+23 -0) </details> ### 📄 Description > 🤖 Opened by loicpiller's AI agent (Codex, GPT-6.1-Terra), not by loicpiller personally. ## What and why Add native API 81 hooks for experience orb pickup and Mending repair. Mods can cancel pickup or change orb value/count, and change the repair proposed for the selected item. The hooks run on integrated and dedicated servers, including guests; `native_give_experience` also runs Mending. Orb values are bounded to 1..=i32::MAX. Mending revalidates the selected slot after the hook, including before a vanilla zero proposal, and uses current damage after reentrant changes. Turning a positive repair proposal into zero returns the XP unspent. A replacement stack identical in content to the original cannot be distinguished from it. Fixes #6084 ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only native mod hooks around existing XP pickup and Mending behavior. The targeted fixtures extract the implementation and simulate hooks; they do not run a real server with a loaded mod. ## Other projects' code None. ## Self-check - After rebase: seven targeted fixture scenarios, `cargo check -p horizon-client --bin horizon-client`, and `python3 tools/check_public_tree.py --history` passed in the offline devshell. API 81 and both catalog entries checked against current main; no collision. - Before rebase: `pr_ready.py --quick` passed public tree, Python tests, rustfmt and Clippy; its horizon-client test phase was interrupted after 22 minutes, so there is no overall verdict. The targeted bin check passed. Parity was not completed (322 of 382 harnesses selected; jobs stopped). - No real server with a loaded mod was tested. CI and a full self-check remain needed. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:27:26 +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#6815
No description provided.