[PR #6635] [MERGED] Native mods: hanging placement and bucket emptying, cancellable (part of #5816) #7002

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

📋 Pull Request Information

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

Base: main ← Head: feat-protection-hooks


📝 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

97 files changed (+11318 additions, -1973 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 (+46 -7)
📝 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 77 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 two protection hooks, one commit and fragment each.

  • native_hanging_place(player, name, kind, pos, cancel): a server player places an item frame, painting or leash knot; cancel places nothing.
  • native_bucket_empty(player, name, pos, fluid, cancel): a server player empties a bucket, before the fluid is placed; cancel places nothing.
  • Where a player acts, the hook runs with their state swapped in (native_acting_player, native_tell and the item helpers work). Nothing changes when no mod hooks them.

Kind

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

Vanilla reference

NeoForge/Bukkit: TNTPrimeEvent, HangingPlaceEvent, PlayerBucketEmptyEvent.

Other projects' code

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

Proof on a real dedicated server

Engine from the batch branch these commits come from, plus a throwaway bundle with one helper per hook; one server run, two phases (mod only listens, then mod cancels). Every hook line is preceded by native_acting_player=Some(..) native_tell=true.

phase A (listen):  place item_frame / painting -> entity present, hanging_place line; water bucket -> water placed, bucket_empty line
phase B (cancel):  item_frame / painting -> none placed (hook line cancel=true); water bucket -> no water

Not covered: the TNT, projectile and hanging-break hooks of the same branch (TNT is being reworked on current main, the projectile hook overlaps upstream's projectile_impact, the hanging-break hook did not fire in the proof run); the LAN host as a player.

Self-check

pr_ready --quick --base upstream/main was not run on this exact bundle; the full branch it was cut from was built and probed, and the cut is checked by cargo test -p horizon-client native_hooks (the hook and fragment catalog) on current main. This PR is those commits cherry-picked onto current main (8 files changed, 133 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/6635 **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:** `feat-protection-hooks` --- ### 📝 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 **97 files changed** (+11318 additions, -1973 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` (+46 -7) 📝 `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 77 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 two protection hooks, one commit and fragment each. - `native_hanging_place(player, name, kind, pos, cancel)`: a server player places an item frame, painting or leash knot; `cancel` places nothing. - `native_bucket_empty(player, name, pos, fluid, cancel)`: a server player empties a bucket, before the fluid is placed; `cancel` places nothing. - Where a player acts, the hook runs with their state swapped in (`native_acting_player`, `native_tell` and the item helpers work). Nothing changes when no mod hooks them. ## Kind - [x] feature (two new native hook points, one commit each) ## Vanilla reference NeoForge/Bukkit: `TNTPrimeEvent`, `HangingPlaceEvent`, `PlayerBucketEmptyEvent`. ## Other projects' code none. (Tested with a throwaway horizon-mixins bundle, not part of this PR.) ## Proof on a real dedicated server Engine from the batch branch these commits come from, plus a throwaway bundle with one helper per hook; one server run, two phases (mod only listens, then mod cancels). Every hook line is preceded by `native_acting_player=Some(..) native_tell=true`. ``` phase A (listen): place item_frame / painting -> entity present, hanging_place line; water bucket -> water placed, bucket_empty line phase B (cancel): item_frame / painting -> none placed (hook line cancel=true); water bucket -> no water ``` Not covered: the TNT, projectile and hanging-break hooks of the same branch (TNT is being reworked on current main, the projectile hook overlaps upstream's `projectile_impact`, the hanging-break hook did not fire in the proof run); the LAN host as a player. ## Self-check `pr_ready --quick --base upstream/main` was not run on this exact bundle; the full branch it was cut from was built and probed, and the cut is checked by `cargo test -p horizon-client native_hooks` (the hook and fragment catalog) on current main. This PR is those commits cherry-picked onto current main (8 files changed, 133 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:43 +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#7002
No description provided.