[PR #6624] [MERGED] Native mods: armor stand manipulation, vehicle moves, container opening and creative slots (part of #5816) #6994

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6624
Author: @Detimes
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: batch-misc


📝 Commits (10+)

  • 8a65c97 Merge the profiles prerequisite onto current main for Setup
  • d48b592 Splitscreen: arrange players with a Setup map and Apply/Revert
  • fb0496a Align Setup pause icons and seed the saved switch in live checks
  • 4d0553b Add native_armor_stand_manipulate hook
  • 3139a6b Add native_vehicle_moved hook
  • 69af122 Add native_container_opened hook
  • 69096a5 Add native_creative_slot hook
  • 78295e8 Merge upstream/main: keep both hooks
  • 69ce6f6 Merge current main into the Setup rebuild
  • ab3ebbd Native mods: a player swapping their hands, cancellable (native_player_swap_hands)

📊 Changes

92 files changed (+11058 additions, -1955 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+12 -6)
📝 crates/horizon-client-render/src/lib.rs (+2 -0)
📝 crates/horizon-client-render/src/mesher.rs (+15 -19)
📝 crates/horizon-client-render/src/mesher/reuse_tests.rs (+60 -1)
📝 crates/horizon-client-render/src/mesher/sides.rs (+5 -4)
📝 crates/horizon-client-render/src/options_ui.rs (+32 -12)
📝 crates/horizon-client-render/src/split_layout.rs (+487 -25)
➕ crates/horizon-client-render/src/split_map.rs (+166 -0)
➕ crates/horizon-client-render/src/split_ui.rs (+716 -0)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+31 -2)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+35 -6)
📝 crates/horizon-client/src/benchmark.rs (+90 -1)
📝 crates/horizon-client/src/breathing.rs (+1 -1)
📝 crates/horizon-client/src/client_lib.rs (+4 -3)
📝 crates/horizon-client/src/crafting.rs (+1 -1)
📝 crates/horizon-client/src/entry.rs (+47 -0)
📝 crates/horizon-client/src/game.rs (+29 -6)
📝 crates/horizon-client/src/game/agent.rs (+9 -2)
📝 crates/horizon-client/src/game/armor_stands.rs (+17 -0)
📝 crates/horizon-client/src/game/commands.rs (+22 -0)

...and 72 more files

📄 Description

🤖 Opened by Detimes' AI agent (Claude Code, Claude Sonnet 5.5), not by Detimes personally.

What and why

Part of #5816 (hook points a survival server's native mods need). A themed bundle of four hooks (interaction events a protection or audit mod needs), as agreed with the maintainers (up to about five related hooks per PR, each with its own proof, one API bump). Each is its own commit and fragment.

  • native_armor_stand_manipulate(player, name, stand_id, slot, cancel): a player takes or puts an item on an armor stand (armor_stands.rs); cancel leaves the stand unchanged.
  • native_vehicle_moved(player, kind, from, to): once per tick when a boat or minecart carrying or last driven by a server player moved; cheap when no mod hooks it (only computed if positions changed).
  • native_container_opened(player, name, kind, pos, cancel): a server player opens a vanilla container menu (chest, crafting table, ...); cancel stops it opening.
  • native_creative_slot(player, name, slot, item, count, cancel): a creative-mode player sets a slot from the creative inventory (SetCreativeModeSlot); cancel ignores it.
  • Where a player acts, the hook runs with their state swapped in (native_acting_player, native_tell, the item helpers work). Nothing changes when no mod hooks them.

Kind

  • feature (four new native hook points, one commit each)

Vanilla reference

PlayerArmorStandManipulateEvent / NeoForge PlayerInteractEvent.EntityInteractSpecific; VehicleMoveEvent; NeoForge PlayerContainerEvent.Open; ServerGamePacketListenerImpl.handleSetCreativeModeSlot.

Other projects' code

none. (Tested with a throwaway horizon-mixins bundle, not part of this PR.)

Proof on a real dedicated server

Engine from this branch plus a throwaway bundle with one helper per hook; one server run, one probe (B4Probe). Every hook line is preceded by native_acting_player=Some(..) native_tell=true.

armor stand: idle control -> no hook line; right-click with a helmet -> slot=head, stand gets the helmet; chestplate with the mod cancelling -> stand unchanged; without cancel -> chestplate on the stand
container:   right-click a chest -> kind=generic_9x3 pos=[100,-60,103], 1 OpenScreen; crafting table with cancel -> 0 OpenScreen; without cancel -> 1 OpenScreen
creative:    control: survival client sends the packet -> no hook line; creative sets slot 36 to 5 diamonds -> hotbar slot 0 holds 5 diamonds; slot 37 to 7 diamonds with cancel -> unchanged
vehicle:     control: boat moved by a command before anyone rode it -> no line; riding with 12 MoveVehicle packets -> 12 vehicle_moved lines (oak_boat, +0.3 east each); riding standing still -> no line

Not covered: a boat left by its rider (heard with no player), the LAN host as a player; the vehicle part covers a boat, not a minecart.

Self-check

pr_ready --quick --base upstream/main on this branch: Public tree, rustfmt, clippy, horizon-client tests (561) and doc tests pass; parity not run (--quick). Upstream main was merged into the branch afterwards. This PR is those commits cherry-picked onto current main (14 files changed, 377 insertions(+), 1 deletion(-)): cargo test -p horizon-client native_hooks passes (21 passed).


🔄 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/6624 **Author:** [@Detimes](https://github.com/Detimes) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `batch-misc` --- ### 📝 Commits (10+) - [`8a65c97`](https://github.com/horizon-rust/horizon/commit/8a65c97f3b2ee6a1f2536db6faa2bedbca5f62a8) Merge the profiles prerequisite onto current main for Setup - [`d48b592`](https://github.com/horizon-rust/horizon/commit/d48b592ddde908a6ccba643cc27d1411bbdebd95) Splitscreen: arrange players with a Setup map and Apply/Revert - [`fb0496a`](https://github.com/horizon-rust/horizon/commit/fb0496a105f785cfb7e9165d3c228935161e9a6f) Align Setup pause icons and seed the saved switch in live checks - [`4d0553b`](https://github.com/horizon-rust/horizon/commit/4d0553be6ea6c79866eb038e721ed693eb5228b1) Add native_armor_stand_manipulate hook - [`3139a6b`](https://github.com/horizon-rust/horizon/commit/3139a6b8c049c55c1f4e9f508ee3badab42ec49c) Add native_vehicle_moved hook - [`69af122`](https://github.com/horizon-rust/horizon/commit/69af122b0d05f249b3d1ed443f145285c07e5b05) Add native_container_opened hook - [`69096a5`](https://github.com/horizon-rust/horizon/commit/69096a58772f0f433c25502a599cd12e4faaef4c) Add native_creative_slot hook - [`78295e8`](https://github.com/horizon-rust/horizon/commit/78295e840f5f336b6a82c93f545a3566b84d11ff) Merge upstream/main: keep both hooks - [`69ce6f6`](https://github.com/horizon-rust/horizon/commit/69ce6f6c2635ceb282e0d8ea9dfc0bf2197286d0) Merge current main into the Setup rebuild - [`ab3ebbd`](https://github.com/horizon-rust/horizon/commit/ab3ebbdd653d3348ff6e56460eabff0493dcbfd9) Native mods: a player swapping their hands, cancellable (native_player_swap_hands) ### 📊 Changes **92 files changed** (+11058 additions, -1955 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+12 -6) 📝 `crates/horizon-client-render/src/lib.rs` (+2 -0) 📝 `crates/horizon-client-render/src/mesher.rs` (+15 -19) 📝 `crates/horizon-client-render/src/mesher/reuse_tests.rs` (+60 -1) 📝 `crates/horizon-client-render/src/mesher/sides.rs` (+5 -4) 📝 `crates/horizon-client-render/src/options_ui.rs` (+32 -12) 📝 `crates/horizon-client-render/src/split_layout.rs` (+487 -25) ➕ `crates/horizon-client-render/src/split_map.rs` (+166 -0) ➕ `crates/horizon-client-render/src/split_ui.rs` (+716 -0) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+31 -2) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+35 -6) 📝 `crates/horizon-client/src/benchmark.rs` (+90 -1) 📝 `crates/horizon-client/src/breathing.rs` (+1 -1) 📝 `crates/horizon-client/src/client_lib.rs` (+4 -3) 📝 `crates/horizon-client/src/crafting.rs` (+1 -1) 📝 `crates/horizon-client/src/entry.rs` (+47 -0) 📝 `crates/horizon-client/src/game.rs` (+29 -6) 📝 `crates/horizon-client/src/game/agent.rs` (+9 -2) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+17 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+22 -0) _...and 72 more files_ </details> ### 📄 Description > 🤖 Opened by Detimes' AI agent (Claude Code, Claude Sonnet 5.5), not by Detimes personally. ## What and why Part of #5816 (hook points a survival server's native mods need). A themed bundle of four hooks (interaction events a protection or audit mod needs), as agreed with the maintainers (up to about five related hooks per PR, each with its own proof, one API bump). Each is its own commit and fragment. - `native_armor_stand_manipulate(player, name, stand_id, slot, cancel)`: a player takes or puts an item on an armor stand (`armor_stands.rs`); `cancel` leaves the stand unchanged. - `native_vehicle_moved(player, kind, from, to)`: once per tick when a boat or minecart carrying or last driven by a server player moved; cheap when no mod hooks it (only computed if positions changed). - `native_container_opened(player, name, kind, pos, cancel)`: a server player opens a vanilla container menu (chest, crafting table, ...); `cancel` stops it opening. - `native_creative_slot(player, name, slot, item, count, cancel)`: a creative-mode player sets a slot from the creative inventory (`SetCreativeModeSlot`); `cancel` ignores it. - Where a player acts, the hook runs with their state swapped in (`native_acting_player`, `native_tell`, the item helpers work). Nothing changes when no mod hooks them. ## Kind - [x] feature (four new native hook points, one commit each) ## Vanilla reference `PlayerArmorStandManipulateEvent` / NeoForge `PlayerInteractEvent.EntityInteractSpecific`; `VehicleMoveEvent`; NeoForge `PlayerContainerEvent.Open`; `ServerGamePacketListenerImpl.handleSetCreativeModeSlot`. ## Other projects' code none. (Tested with a throwaway horizon-mixins bundle, not part of this PR.) ## Proof on a real dedicated server Engine from this branch plus a throwaway bundle with one helper per hook; one server run, one probe (`B4Probe`). Every hook line is preceded by `native_acting_player=Some(..) native_tell=true`. ``` armor stand: idle control -> no hook line; right-click with a helmet -> slot=head, stand gets the helmet; chestplate with the mod cancelling -> stand unchanged; without cancel -> chestplate on the stand container: right-click a chest -> kind=generic_9x3 pos=[100,-60,103], 1 OpenScreen; crafting table with cancel -> 0 OpenScreen; without cancel -> 1 OpenScreen creative: control: survival client sends the packet -> no hook line; creative sets slot 36 to 5 diamonds -> hotbar slot 0 holds 5 diamonds; slot 37 to 7 diamonds with cancel -> unchanged vehicle: control: boat moved by a command before anyone rode it -> no line; riding with 12 MoveVehicle packets -> 12 vehicle_moved lines (oak_boat, +0.3 east each); riding standing still -> no line ``` Not covered: a boat left by its rider (heard with no player), the LAN host as a player; the vehicle part covers a boat, not a minecart. ## Self-check `pr_ready --quick --base upstream/main` on this branch: Public tree, rustfmt, clippy, `horizon-client` tests (561) and doc tests pass; parity not run (`--quick`). Upstream main was merged into the branch afterwards. This PR is those commits cherry-picked onto current main (14 files changed, 377 insertions(+), 1 deletion(-)): `cargo test -p horizon-client native_hooks` passes (21 passed). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:31:10 +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#6994
No description provided.