[PR #7348] [MERGED] Fence knots: a click on the knot takes the mob back, a click on the fence only ties #7540

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

📋 Pull Request Information

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

Base: main ← Head: fix/fence-knot-click


📝 Commits (2)

  • ba1caf3 Fence knots: a click on the knot takes the mob back, a click on the fence only ties
  • be39771 Merge main: the mod API placeholder test is fixed there

📊 Changes

6 files changed (+79 additions, -31 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -5)
📝 crates/horizon-client/src/game/lan_actions.rs (+28 -0)
📝 crates/horizon-client/src/game/leads.rs (+10 -23)
📝 crates/horizon-client/src/game/remote.rs (+2 -2)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+35 -1)
📝 tools/port_map/game2-002.tsv (+1 -0)

📄 Description

🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally.

What and why

Fixes #6803.

Clicking a fence knot didn't take the mob back, and in single player a fence click didn't tie it. Both come from sending the knot's click as a click on the fence:

  • A client of any server. The crosshair never met the knot, so LeashFenceKnotEntity.interact was never asked for. The client sent UseItemOn for the fence, which on vanilla's server is LeadItem.useOn: it only ties. A mob tied to a fence could not be taken back. Now the knot is pickable for a use (BlockAttachedEntity.isPickable, remote_knot_hit) and the client sends Interact with its id.
  • Horizon's own server. It read a fence click inside the knot's box as a knot click (#5514). In single player a click left the mob held. My reading is that the click comes once per hand, so the first ties and the second takes it back, which fits the lead flashing on the fence in #6803; I didn't log the two packets. A fence click now only ties, as LeadItem.useOn does, and handleInteract with a knot's id goes to use_knot.

Still different from vanilla, in the ledger: a Horizon attack goes to the fence behind a knot, where vanilla's hits the knot.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

LeashFenceKnotEntity.interact, BlockAttachedEntity.isPickable (read with tools/rea_vanilla.py).

Checked with horizon-ctl on Windows, offscreen: a NoAI cow is leashed with a lead, the crosshair aims at the knot's centre (y + 0.625), a click ties it, then a click with an empty hand. This is a local script, not a harness added here.

Where Holder read from Nightly c9d474d This branch
vanilla 26.3's dedicated server (offline mode) the server's /data get entity ... leash tied, then still the fence tied, then the player
single player horizon-ctl mobs stays the player, never tied tied, then the player

@DUzzL's comment on #6803 saw a short click tie in single player on main at the time, so a reviewer may want to compare: here both clicks went through mouse right click.

Not checked: a physical mouse, LAN with a second real player, sneaking on a knot, shears on a knot, and check_leads in tools/lan_e2e.py. The single player row was run before the merge of main that moved native_entity_unleash into this file; the branch merges cleanly with it but this wasn't run on that merge.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on naza, against upstream/main at 0f0fa62dc, 7 min 44 s)

Check Result
Scope ✅ 6 files, +79 −31
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (2 min 4 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 28 s)
tests: horizon-client ✅ 681 passed (3 min 18 s)
doc tests ✅ 0 passed (4 s)
mod API up to date ✅ (32 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/pull/7348 **Author:** [@4404c](https://github.com/4404c) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/fence-knot-click` --- ### 📝 Commits (2) - [`ba1caf3`](https://github.com/horizon-rust/horizon/commit/ba1caf38a95471bf0d59f3d135ca36dbe4e5d894) Fence knots: a click on the knot takes the mob back, a click on the fence only ties - [`be39771`](https://github.com/horizon-rust/horizon/commit/be3977105bcba12462319b7bbdc2db667f9b7f88) Merge main: the mod API placeholder test is fixed there ### 📊 Changes **6 files changed** (+79 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -5) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+28 -0) 📝 `crates/horizon-client/src/game/leads.rs` (+10 -23) 📝 `crates/horizon-client/src/game/remote.rs` (+2 -2) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+35 -1) 📝 `tools/port_map/game2-002.tsv` (+1 -0) </details> ### 📄 Description > 🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally. ## What and why Fixes #6803. Clicking a fence knot didn't take the mob back, and in single player a fence click didn't tie it. Both come from sending the knot's click as a click on the fence: - **A client of any server.** The crosshair never met the knot, so `LeashFenceKnotEntity.interact` was never asked for. The client sent `UseItemOn` for the fence, which on vanilla's server is `LeadItem.useOn`: it only ties. A mob tied to a fence could not be taken back. Now the knot is pickable for a use (`BlockAttachedEntity.isPickable`, `remote_knot_hit`) and the client sends `Interact` with its id. - **Horizon's own server.** It read a fence click inside the knot's box as a knot click (#5514). In single player a click left the mob held. My reading is that the click comes once per hand, so the first ties and the second takes it back, which fits the lead flashing on the fence in #6803; I didn't log the two packets. A fence click now only ties, as `LeadItem.useOn` does, and `handleInteract` with a knot's id goes to `use_knot`. Still different from vanilla, in the ledger: a Horizon attack goes to the fence behind a knot, where vanilla's hits the knot. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `LeashFenceKnotEntity.interact`, `BlockAttachedEntity.isPickable` (read with `tools/rea_vanilla.py`). Checked with `horizon-ctl` on Windows, offscreen: a NoAI cow is leashed with a lead, the crosshair aims at the knot's centre (y + 0.625), a click ties it, then a click with an empty hand. This is a local script, not a harness added here. | Where | Holder read from | Nightly c9d474d | This branch | |---|---|---|---| | vanilla 26.3's dedicated server (offline mode) | the server's `/data get entity ... leash` | tied, then **still the fence** | tied, then the player | | single player | `horizon-ctl mobs` | stays the player, **never tied** | tied, then the player | @DUzzL's comment on #6803 saw a short click tie in single player on main at the time, so a reviewer may want to compare: here both clicks went through `mouse right click`. Not checked: a physical mouse, LAN with a second real player, sneaking on a knot, shears on a knot, and `check_leads` in `tools/lan_e2e.py`. The single player row was run before the merge of main that moved `native_entity_unleash` into this file; the branch merges cleanly with it but this wasn't run on that merge. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on naza, against upstream/main at 0f0fa62dc, 7 min 44 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +79 −31 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (2 min 4 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 28 s) | | tests: horizon-client | ✅ 681 passed (3 min 18 s) | | doc tests | ✅ 0 passed (4 s) | | mod API up to date | ✅ (32 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 07:19:20 +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#7540
No description provided.