[PR #2123] [MERGED] Server players see fence knots and leads tied to fences #4025

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2123
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/remote-leash-knots


📝 Commits (3)

  • 3287a74 Send fence knots to server players so leads tied to fences are drawn
  • ab40cd6 Merge origin/main into fix/remote-leash-knots
  • 8f78fde Keep leash knot ids per level and clear remote knots with the other remote objects

📊 Changes

6 files changed (+65 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/lan.rs (+2 -2)
📝 crates/horizon-client/src/game/lan_entities.rs (+28 -0)
📝 crates/horizon-client/src/game/levels.rs (+4 -0)
📝 crates/horizon-client/src/game/remote.rs (+8 -2)
📝 crates/horizon-client/src/game/remote_objects.rs (+15 -2)

📄 Description

What and why

A mob tied to a fence showed no knot and no lead to server players and LAN guests. The server sent the mob's link as "no holder" because a fence knot had no entity id, and the client only knew player and mob holders.

Now each fence post with a lead on it gets an entity id on the hosting side and is sent as minecraft:leash_knot at its block. The mob's link points at that id. On the receiving side, a minecraft:leash_knot entity is remembered by id, a link to it ties the mob to that fence post (so the existing rope and knot drawing is used), and the knot is forgotten when the entity is removed. If the link arrives before the knot, the mob waits as a holder by id and is tied to the fence as soon as the knot is added.

Vanilla reference

  • LeashFenceKnotEntity: block-attached entity at the fence block, getAddEntityPacket sends the block position, notifyLeasheeRemoved discards it once nothing hangs on it.
  • ClientboundSetEntityLinkPacket and ClientPacketListener.handleEntityLinkPacket (the holder id is resolved later if the entity is not there yet).
  • ClientboundAddEntityPacket for block-attached entities.

Self-check

cargo check -p horizon-client passes.


🔄 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/2123 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/remote-leash-knots` --- ### 📝 Commits (3) - [`3287a74`](https://github.com/horizon-rust/horizon/commit/3287a74d64e64ac8b3aa976276987b9b4b93f83f) Send fence knots to server players so leads tied to fences are drawn - [`ab40cd6`](https://github.com/horizon-rust/horizon/commit/ab40cd63e6f584f1a7321146b1738226bcae9b4f) Merge origin/main into fix/remote-leash-knots - [`8f78fde`](https://github.com/horizon-rust/horizon/commit/8f78fdeb7bec717e91fa24394b9bcb940cfc8ae5) Keep leash knot ids per level and clear remote knots with the other remote objects ### 📊 Changes **6 files changed** (+65 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -2) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+28 -0) 📝 `crates/horizon-client/src/game/levels.rs` (+4 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+8 -2) 📝 `crates/horizon-client/src/game/remote_objects.rs` (+15 -2) </details> ### 📄 Description ## What and why A mob tied to a fence showed no knot and no lead to server players and LAN guests. The server sent the mob's link as "no holder" because a fence knot had no entity id, and the client only knew player and mob holders. Now each fence post with a lead on it gets an entity id on the hosting side and is sent as `minecraft:leash_knot` at its block. The mob's link points at that id. On the receiving side, a `minecraft:leash_knot` entity is remembered by id, a link to it ties the mob to that fence post (so the existing rope and knot drawing is used), and the knot is forgotten when the entity is removed. If the link arrives before the knot, the mob waits as a holder by id and is tied to the fence as soon as the knot is added. ## Vanilla reference - `LeashFenceKnotEntity`: block-attached entity at the fence block, `getAddEntityPacket` sends the block position, `notifyLeasheeRemoved` discards it once nothing hangs on it. - `ClientboundSetEntityLinkPacket` and `ClientPacketListener.handleEntityLinkPacket` (the holder id is resolved later if the entity is not there yet). - `ClientboundAddEntityPacket` for block-attached entities. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:07 +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#4025
No description provided.