[PR #8] [MERGED] Make a mod: native mods (setup, the bundle, hook points) #10

Closed
opened 2026-11-03 04:02:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: docs/make-a-native-mod


📝 Commits (2)

  • 108aa6a Make a mod: native mods (setup, the bundle, hook points)
  • 9c9b8b9 Make a mod: hook points version 2 are on main, not in a Nightly yet

📊 Changes

3 files changed (+399 additions, -230 deletions)

View changed files

📝 docs/make-a-mod.md (+61 -51)
📝 docs/mod-code.md (+250 -141)
📝 docs/mod-manifest.md (+88 -38)

📄 Description

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

First of three stacked PRs that rewrite "Make a mod" for the two kinds of mod that stay once WebAssembly code mods are removed (horizon#3371): content mods and native mods. This one rewrites three pages:

  • Make a mod (make-a-mod): the two kinds side by side and which to pick; how a native mod works (horizon-mixins, Horizon's hook points); the tools (Rust, horizon-mods' native.py, launcher 0.2.23+); the files of a mod; native.py check; horizon-launcher native-build … --trust-native-code; what players see (the notice once, Settings > Native mods, Build, the red warning, the Native mods instance, Options > Mods with Settings and keys).
  • The bundle (mod-manifest): horizon-mixin.toml part by part, helpers and bindings, hook points versus a pinned commit, compatibility.json, the .hnmod, and why native mods are reviewed rather than sandboxed.
  • Hook points and helpers (mod-code): every hook point and helper in native_hooks.rs of the current Nightly, version 2 (item panel, recipes) marked "next Nightly", and a worked example, Playtime.

The page slugs stay the same, so links from elsewhere keep working. Only what works on Horizon main, the current Nightly (6f8c7a0) and launcher 0.2.23+ is described, with no dates. horizon's docs/native-mods.md is the source; two stale statements there are fixed in a Horizon PR.

The example is real

Playtime (/private/tmp/om2-playtime/playtime on the Mac mini, exactly the code on the page):

  • cargo test: 2 passed.
  • native.py check /path/to/playtime from a horizon-mods clone, on Nightly 6f8c7a0: ok, with warnings as errors (2 min 31 s cold).
  • native.py proof (fast build, offscreen game driven with horizon-ctl, commands typed into the chat box as a player does):
    • Options > Mods shows "Playtime 0.1.0: ON"; its page shows "Shown: ON", and a click writes shown = false.
    • A saved count of 71990 ticks reaches 72000 and is saved again.
    • The HUD box shows "Played 1h 00m"; /playtime answers "You have played 1h 00m"; /playtime reset answers "Playtime reset", writes 0 and the box shows "Played 0h 00m".

Checks

  • HORIZON_CHECKOUT=<horizon main> node build.mjs: built. (A link to publish-a-mod#package-a-native-mod and content-mods#the-manifest waits for the next PR, which adds those sections.)
  • node --test src/ scripts/: 48 pass.

Order

  1. This PR, then #9 (content mods, testing, publishing), then #10 (players' Mods page, APIs, How Horizon is built, Modpacks, index). #7 (native mods listed on /mods, the form takes .hnmod) is independent.
  2. After the three, #6 (still a draft until horizon#3371) only needs its nav.json line that drops api/mods and api/mods-reference: the stack with that line builds against #3371's tip. So the docs land first, the removal after.

🤖 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-site/pull/8 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `docs/make-a-native-mod` --- ### 📝 Commits (2) - [`108aa6a`](https://github.com/horizon-rust/horizon-site/commit/108aa6a8d5c7aaf3b5463239bc78e14e9c568854) Make a mod: native mods (setup, the bundle, hook points) - [`9c9b8b9`](https://github.com/horizon-rust/horizon-site/commit/9c9b8b9a3e0369eba5a1ccf02f8d1e44e3f87d2c) Make a mod: hook points version 2 are on main, not in a Nightly yet ### 📊 Changes **3 files changed** (+399 additions, -230 deletions) <details> <summary>View changed files</summary> 📝 `docs/make-a-mod.md` (+61 -51) 📝 `docs/mod-code.md` (+250 -141) 📝 `docs/mod-manifest.md` (+88 -38) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. First of three stacked PRs that rewrite "Make a mod" for the two kinds of mod that stay once WebAssembly code mods are removed (horizon#3371): **content mods** and **native mods**. This one rewrites three pages: - **Make a mod** (`make-a-mod`): the two kinds side by side and which to pick; how a native mod works (horizon-mixins, Horizon's hook points); the tools (Rust, horizon-mods' `native.py`, launcher 0.2.23+); the files of a mod; `native.py check`; `horizon-launcher native-build … --trust-native-code`; what players see (the notice once, Settings > Native mods, Build, the red warning, the Native mods instance, Options > Mods with Settings and keys). - **The bundle** (`mod-manifest`): `horizon-mixin.toml` part by part, helpers and bindings, hook points versus a pinned commit, `compatibility.json`, the `.hnmod`, and why native mods are reviewed rather than sandboxed. - **Hook points and helpers** (`mod-code`): every hook point and helper in `native_hooks.rs` of the current Nightly, version 2 (item panel, recipes) marked "next Nightly", and a worked example, **Playtime**. The page slugs stay the same, so links from elsewhere keep working. Only what works on Horizon main, the current Nightly (6f8c7a0) and launcher 0.2.23+ is described, with no dates. horizon's docs/native-mods.md is the source; two stale statements there are fixed in a Horizon PR. ## The example is real Playtime (`/private/tmp/om2-playtime/playtime` on the Mac mini, exactly the code on the page): - `cargo test`: 2 passed. - `native.py check /path/to/playtime` from a horizon-mods clone, on Nightly 6f8c7a0: ok, with warnings as errors (2 min 31 s cold). - `native.py proof` (fast build, offscreen game driven with horizon-ctl, commands typed into the chat box as a player does): - Options > Mods shows "Playtime 0.1.0: ON"; its page shows "Shown: ON", and a click writes `shown` = `false`. - A saved count of 71990 ticks reaches 72000 and is saved again. - The HUD box shows "Played 1h 00m"; `/playtime` answers "You have played 1h 00m"; `/playtime reset` answers "Playtime reset", writes 0 and the box shows "Played 0h 00m". ## Checks - `HORIZON_CHECKOUT=<horizon main> node build.mjs`: built. (A link to `publish-a-mod#package-a-native-mod` and `content-mods#the-manifest` waits for the next PR, which adds those sections.) - `node --test src/ scripts/`: 48 pass. ## Order 1. This PR, then #9 (content mods, testing, publishing), then #10 (players' Mods page, APIs, How Horizon is built, Modpacks, index). #7 (native mods listed on /mods, the form takes `.hnmod`) is independent. 2. After the three, #6 (still a draft until horizon#3371) only needs its `nav.json` line that drops `api/mods` and `api/mods-reference`: the stack with that line builds against #3371's tip. So the docs land first, the removal after. 🤖 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 04:02:21 +07:00
Sign in to join this conversation.
No labels
pull-request
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-site#10
No description provided.