[PR #3706] [MERGED] Expose native world open and close hooks #5161

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

📋 Pull Request Information

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

Base: main ← Head: upstream/native-lifecycle


📝 Commits (1)

  • ea10a17 Expose native world lifecycle hooks

📊 Changes

7 files changed (+453 additions, -51 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+17 -0)
📝 crates/horizon-client/src/game/integrated.rs (+88 -49)
📝 crates/horizon-client/src/game/native_hooks.rs (+28 -1)
➕ crates/horizon-client/src/game/native_lifecycle.rs (+307 -0)
📝 docs/native-mods.md (+4 -1)
📝 native-hooks.json (+5 -0)

📄 Description

🤖 Opened by Aria's agent swarm, Dyna, not by Aria.

Expose read-only native world open and close hooks for the authoritative server. Server tick hooks are split into a follow-up branch.

Follows vanilla IntegratedServer.tickServer and stopServer, DedicatedServer.initServer, and MinecraftServer.runServer.

Proof

A test-only native mod observed open, Nether travel, save, close and reopen in both modes. Saves vary even between main runs, so the no-mod comparison is inconclusive; empty hooks and unit tests cover the no-mod path.

Mode Open epochs Missing or out-of-order world events Result
Server thread 1, 2 0 Pass
Dedicated 1, 1 0 Pass

Dedicated epochs restart with each server process. The deprecated in-frame path delivers no lifecycle events.

python3 tools/parity.py dedicated_server server_entities (Java 25): both passed. The first dedicated attempt hit the vanilla watchdog under load; the retry passed.

pr_ready (python3 tools/pr_ready.py --base upstream/main --quick, upstream 7ebf7d26c)

Check Result
Scope ✅ 5 files, +419 −58
Cargo.lock, public tree ✅
Python tests ✅ 423 passed
rustfmt, clippy, doc tests ✅
horizon-client tests ❌ 671 passed, 1 failed; the axolotl NBT assertion also fails on upstream main (#3840)
Game-binary tests ✅ 168 passed, 3 ignored
Parity ➖ 33 affected; quick mode leaves these to CI

🤖 Generated with Dyna


🔄 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/3706 **Author:** [@arismoko](https://github.com/arismoko) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `upstream/native-lifecycle` --- ### 📝 Commits (1) - [`ea10a17`](https://github.com/horizon-rust/horizon/commit/ea10a17842fc79045d9e1ccaa081c8784434336b) Expose native world lifecycle hooks ### 📊 Changes **7 files changed** (+453 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+17 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+88 -49) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+28 -1) ➕ `crates/horizon-client/src/game/native_lifecycle.rs` (+307 -0) 📝 `docs/native-mods.md` (+4 -1) 📝 `native-hooks.json` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Aria's agent swarm, Dyna, not by Aria. Expose read-only native world open and close hooks for the authoritative server. Server tick hooks are split into a follow-up branch. Follows vanilla `IntegratedServer.tickServer` and `stopServer`, `DedicatedServer.initServer`, and `MinecraftServer.runServer`. ### Proof A test-only native mod observed open, Nether travel, save, close and reopen in both modes. Saves vary even between main runs, so the no-mod comparison is inconclusive; empty hooks and unit tests cover the no-mod path. | Mode | Open epochs | Missing or out-of-order world events | Result | | --- | --- | --- | --- | | Server thread | 1, 2 | 0 | Pass | | Dedicated | 1, 1 | 0 | Pass | Dedicated epochs restart with each server process. The deprecated in-frame path delivers no lifecycle events. `python3 tools/parity.py dedicated_server server_entities` (Java 25): both passed. The first dedicated attempt hit the vanilla watchdog under load; the retry passed. **pr_ready** (`python3 tools/pr_ready.py --base upstream/main --quick`, upstream `7ebf7d26c`) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +419 −58 | | Cargo.lock, public tree | ✅ | | Python tests | ✅ 423 passed | | rustfmt, clippy, doc tests | ✅ | | horizon-client tests | ❌ 671 passed, 1 failed; the axolotl NBT assertion also fails on upstream main (#3840) | | Game-binary tests | ✅ 168 passed, 3 ignored | | Parity | ➖ 33 affected; quick mode leaves these to CI | 🤖 Generated with Dyna --- <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: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#5161
No description provided.