[PR #7316] [MERGED] Buckets: claim hooks hear the block a refused bucket pours into #7487

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

📋 Pull Request Information

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

Base: main ← Head: fix/bucket-hook-beside


📝 Commits (3)

  • 93b7010 Buckets: native mods hear the block a refused bucket pours into
  • cabceb3 Docs: the bucket hooks hear the block beside on every such click
  • a3740ff Merge main into #7316

📊 Changes

2 files changed (+16 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+11 -1)
📝 docs/native-mods.md (+5 -2)

📄 Description

Fixes #7314, a gap #6783 opened. Since that PR, a filled bucket that the clicked block refuses (a sneak-click on a waterloggable slab) pours into the block beside the clicked face. But native_fill_bucket and native_bucket_empty were only asked about the bucket's target, the slab. A land-claim mod protecting the block beside could therefore be bypassed. Before #6783 that click simply failed.

These commits were reviewed on #6783's branch but pushed after it merged, so they missed it.

What changes (game.rs, use_tool):

  • When the block beside the clicked face isn't the target, both hooks are asked about it as well. That matches vanilla, which checks mayInteract(blockPos) and mayUseItemAt(blockPos.relative(direction)) on every click.
  • Powder snow is left out. It places like a block and never pours beside.
  • docs/native-mods.md describes the extra call for both hooks.

A mod now hears up to two calls per click. Both have the same signature and cancel contract, so no hook version bump: every hook in native-hooks.json is still at version 1, and the docs ask for a new version only for incompatible changes.

Testing:

  • I didn't run pr_ready.py locally; the host builds in CI only.
  • ci.yml on the fork (https://github.com/some-du6e/horizon/actions/runs/41461493290): fmt and clippy -D warnings pass. One test fails, and the PR didn't cause it: xtask's mod_api::tests::new_hook_placeholder_is_reported_then_filled still reads tools/native-hook-fragments/native_item_damaged.json, which #7258 folded into native-hooks.json. Current main has the same failure.
  • No test covers this. The hooks need a native mod loaded and only run in a full Game, and no existing test exercises them.

Note

Filed by Opus 5.5 using 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/pull/7316 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/bucket-hook-beside` --- ### 📝 Commits (3) - [`93b7010`](https://github.com/horizon-rust/horizon/commit/93b7010f3e9e2b5c5a3c551bb46682ed8d54a17b) Buckets: native mods hear the block a refused bucket pours into - [`cabceb3`](https://github.com/horizon-rust/horizon/commit/cabceb3c17708992a3d0c63141b959a222558665) Docs: the bucket hooks hear the block beside on every such click - [`a3740ff`](https://github.com/horizon-rust/horizon/commit/a3740ffa49804e9e05fedfe6a0daccbe66f305b8) Merge main into #7316 ### 📊 Changes **2 files changed** (+16 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+11 -1) 📝 `docs/native-mods.md` (+5 -2) </details> ### 📄 Description Fixes #7314, a gap #6783 opened. Since that PR, a filled bucket that the clicked block refuses (a sneak-click on a waterloggable slab) pours into the block beside the clicked face. But `native_fill_bucket` and `native_bucket_empty` were only asked about the bucket's target, the slab. A land-claim mod protecting the block beside could therefore be bypassed. Before #6783 that click simply failed. These commits were reviewed on #6783's branch but pushed after it merged, so they missed it. What changes (`game.rs`, `use_tool`): - When the block beside the clicked face isn't the target, both hooks are asked about it as well. That matches vanilla, which checks `mayInteract(blockPos)` and `mayUseItemAt(blockPos.relative(direction))` on every click. - Powder snow is left out. It places like a block and never pours beside. - `docs/native-mods.md` describes the extra call for both hooks. A mod now hears up to two calls per click. Both have the same signature and cancel contract, so no hook version bump: every hook in `native-hooks.json` is still at version 1, and the docs ask for a new version only for incompatible changes. Testing: - I didn't run `pr_ready.py` locally; the host builds in CI only. - `ci.yml` on the fork (https://github.com/some-du6e/horizon/actions/runs/41461493290): fmt and clippy `-D warnings` pass. One test fails, and the PR didn't cause it: xtask's `mod_api::tests::new_hook_placeholder_is_reported_then_filled` still reads `tools/native-hook-fragments/native_item_damaged.json`, which #7258 folded into `native-hooks.json`. Current `main` has the same failure. - No test covers this. The hooks need a native mod loaded and only run in a full `Game`, and no existing test exercises them. > [!NOTE] > Filed by Opus 5.5 using 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 06:40:06 +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#7487
No description provided.