[PR #4763] [MERGED] Make boats and rafts leashable (AbstractBoat is Leashable) #5836

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4763
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/BL-boatlead


📝 Commits (1)

  • 5eb665b Make boats and rafts leashable (AbstractBoat implements Leashable)

📊 Changes

10 files changed (+766 additions, -46 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
➕ crates/horizon-client/src/game/boat_leads.rs (+458 -0)
📝 crates/horizon-client/src/game/boats.rs (+46 -1)
📝 crates/horizon-client/src/game/commands.rs (+7 -1)
📝 crates/horizon-client/src/game/lan_entities.rs (+12 -0)
📝 crates/horizon-client/src/game/leads.rs (+81 -33)
📝 crates/horizon-client/src/game/persist.rs (+5 -0)
📝 crates/horizon-client/src/game/remote.rs (+15 -11)
📝 crates/horizon-client/src/game/remote_objects.rs (+5 -0)
📝 crates/horizon-client/src/mobs/leash.rs (+136 -0)

📄 Description

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

Part of #3519

What and why

AbstractBoat implements Leashable in vanilla; Horizon's boats and rafts had no lead at all. They now take a lead like a mob does, on the server-thread path (LAN guests and dedicated servers share the code), and clients draw it from the entity link.

Rows

  • LeashFeatureRenderer (boats): a leashed boat or raft draws its rope from getLeashOffset, or four straight ropes from getQuadLeashOffsets to a happy ghast's getQuadLeashHolderOffsets (AbstractBoat.supportQuadLeash). leads.rs now builds one Rope per leashed mob or boat and draws them the same way.

Behaviour added (all for boats and rafts)

  • Entity.interact: a lead ties the boat to the player (a held boat is dropped first), clicking your own boat unties it (removeLeash in creative, else dropLeash), shears snip it; this runs before the boat's seating and the chest boat's menu, as in vanilla.
  • LeadItem.bindPlayerMobs / LeashFenceKnotEntity.interact / sneak-click on a mob: the boats on the player's lead tie to the fence or mob, and a fence's boats go back to the player.
  • Leashable.tickLeash at the end of baseTick: holder gone or dead drops the lead, past 12 blocks it snaps (sound), past 6 less the widths the elastic pull applies (checkElasticInteractions, with the four-corner quad case at a quarter each), angular momentum turns the boat, angularFriction. HappyGhast.notifyLeashHolder is called.
  • AbstractBoat.remove (broken, /kill): the lead drops. ClientboundSetEntityLinkPacket for boats, including the knot an id arrives before.
  • AbstractBoat.addAdditionalSaveData / readAdditionalSaveData: the leash tag, with restoreLeashFromSave's 100 tick wait.

Vanilla methods followed

AbstractBoat.getLeashOffset/getQuadLeashOffsets/supportQuadLeash/remove/interact, Leashable.tickLeash/checkElasticInteractions/computeDampenedSpringInteraction/dropLeash/setLeashedTo/restoreLeashFromSave/angularFriction, Entity.interact/shearOffAllLeashConnections, EntityRenderer.extractRenderState (leash part), LeadItem.bindPlayerMobs, LeashFenceKnotEntity.interact.

Not changed

A boat cannot itself be the holder (sneak-clicking a boat with mobs on your lead does not tie them to it). A ridden boat's elastic pull is applied to the server's copy only, because its rider's client moves it.

How it was checked

cargo fmt, clippy -p horizon-client --all-targets -D warnings, unit tests for the boat's offsets, elastic_pull against the mob spring and the quad case. Not run in game; CI verify is the full check.

🤖 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/4763 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/BL-boatlead` --- ### 📝 Commits (1) - [`5eb665b`](https://github.com/horizon-rust/horizon/commit/5eb665b1c3f96e57b422b6176171ec6ebd29669a) Make boats and rafts leashable (AbstractBoat implements Leashable) ### 📊 Changes **10 files changed** (+766 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) ➕ `crates/horizon-client/src/game/boat_leads.rs` (+458 -0) 📝 `crates/horizon-client/src/game/boats.rs` (+46 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+7 -1) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+12 -0) 📝 `crates/horizon-client/src/game/leads.rs` (+81 -33) 📝 `crates/horizon-client/src/game/persist.rs` (+5 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+15 -11) 📝 `crates/horizon-client/src/game/remote_objects.rs` (+5 -0) 📝 `crates/horizon-client/src/mobs/leash.rs` (+136 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 ## What and why `AbstractBoat implements Leashable` in vanilla; Horizon's boats and rafts had no lead at all. They now take a lead like a mob does, on the server-thread path (LAN guests and dedicated servers share the code), and clients draw it from the entity link. ## Rows - `LeashFeatureRenderer (boats)`: a leashed boat or raft draws its rope from `getLeashOffset`, or four straight ropes from `getQuadLeashOffsets` to a happy ghast's `getQuadLeashHolderOffsets` (`AbstractBoat.supportQuadLeash`). `leads.rs` now builds one `Rope` per leashed mob or boat and draws them the same way. ## Behaviour added (all for boats and rafts) - `Entity.interact`: a lead ties the boat to the player (a held boat is dropped first), clicking your own boat unties it (`removeLeash` in creative, else `dropLeash`), shears snip it; this runs before the boat's seating and the chest boat's menu, as in vanilla. - `LeadItem.bindPlayerMobs` / `LeashFenceKnotEntity.interact` / sneak-click on a mob: the boats on the player's lead tie to the fence or mob, and a fence's boats go back to the player. - `Leashable.tickLeash` at the end of `baseTick`: holder gone or dead drops the lead, past 12 blocks it snaps (sound), past 6 less the widths the elastic pull applies (`checkElasticInteractions`, with the four-corner quad case at a quarter each), angular momentum turns the boat, `angularFriction`. `HappyGhast.notifyLeashHolder` is called. - `AbstractBoat.remove` (broken, `/kill`): the lead drops. `ClientboundSetEntityLinkPacket` for boats, including the knot an id arrives before. - `AbstractBoat.addAdditionalSaveData` / `readAdditionalSaveData`: the `leash` tag, with `restoreLeashFromSave`'s 100 tick wait. ## Vanilla methods followed `AbstractBoat.getLeashOffset/getQuadLeashOffsets/supportQuadLeash/remove/interact`, `Leashable.tickLeash/checkElasticInteractions/computeDampenedSpringInteraction/dropLeash/setLeashedTo/restoreLeashFromSave/angularFriction`, `Entity.interact/shearOffAllLeashConnections`, `EntityRenderer.extractRenderState` (leash part), `LeadItem.bindPlayerMobs`, `LeashFenceKnotEntity.interact`. ## Not changed A boat cannot itself be the holder (sneak-clicking a boat with mobs on your lead does not tie them to it). A ridden boat's elastic pull is applied to the server's copy only, because its rider's client moves it. ## How it was checked `cargo fmt`, `clippy -p horizon-client --all-targets -D warnings`, unit tests for the boat's offsets, `elastic_pull` against the mob `spring` and the quad case. Not run in game; CI `verify` is the full check. 🤖 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 05:15: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#5836
No description provided.