[PR #4773] [MERGED] Boats can hold leads (Entity.interact sneak branch) #5843

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

📋 Pull Request Information

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

Base: main ← Head: parity/bl2-leash-holder


📝 Commits (1)

  • 8fc8f02 Boats and mobs on a lead can hang on a boat (Entity.interact sneak branch, game events)

📊 Changes

12 files changed (+172 additions, -29 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+1 -0)
📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/boat_leads.rs (+97 -11)
📝 crates/horizon-client/src/game/commands/execute.rs (+2 -1)
📝 crates/horizon-client/src/game/creatures.rs (+7 -0)
📝 crates/horizon-client/src/game/lan.rs (+1 -1)
📝 crates/horizon-client/src/game/leads.rs (+46 -15)
📝 crates/horizon-client/src/game/remote.rs (+3 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/leash.rs (+8 -1)
📝 crates/horizon-client/src/mobs/world.rs (+1 -0)
📝 crates/horizon-client/src/mobs/zombie_villager.rs (+1 -0)

📄 Description

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

Part of #3519

What and why

Follow-up to #4763. A boat (AbstractBoat is Leashable) can now be a lead's holder, and the rest of Entity.interact's lead branches match vanilla.

Rows

  • Entity.interact (leash holder): sneak-clicking a boat while mobs or boats hang on your lead ties each one that canHaveALeashAttachedTo it (not itself, within 12 blocks) to the boat, with the entity_action game event and the tied sound. The same sneak click on a mob now goes through one shared tie_player_leads. New Holder::Boat(id): mobs tick their pull and snap against it (MobWorld.leash_boats), boats do too (boat_leads.rs), the rope ends at getRopeHoldPosition (position + 0.7 of the 0.5625 eye height), the link packet carries the boat's id, the leash tag saves its UUID and restores it after load, and a removed boat drops what hangs on it through the existing holder-gone path.
  • Rest of Entity.interact, compared with mobs and boats: shears now snip every lead on a boat (its own and those hanging on it) and post the shear game event; untying posts entity_interact (mobs and boats). Cycles are allowed as in vanilla (canHaveALeashAttachedTo only rejects this == entity and range).
  • Elastic pull on a ridden boat: no change. Leashable.tickLeash runs on the server only, and a boat driven by its rider's client takes that client's position back in ServerGamePacketListenerImpl.handleMoveVehicle, so vanilla never moves it by the rope either. Horizon's server copy gets the pull and the rider's client overwrites it the same way. Documented in boat_leads.rs.

Vanilla methods followed

Entity.interact, Entity.shearOffAllLeashConnections/dropAllLeashConnections, Entity.getRopeHoldPosition, Leashable.canHaveALeashAttachedTo/leashableInArea/setLeashedTo/tickLeash, ServerGamePacketListenerImpl.handleMoveVehicle.

How it was checked

cargo fmt, clippy -p horizon-client --all-targets -D warnings, unit tests for a boat's holder state. 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/4773 **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/bl2-leash-holder` --- ### 📝 Commits (1) - [`8fc8f02`](https://github.com/horizon-rust/horizon/commit/8fc8f028202a803ee3c5bcded98e32f35c641088) Boats and mobs on a lead can hang on a boat (Entity.interact sneak branch, game events) ### 📊 Changes **12 files changed** (+172 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+1 -0) 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/boat_leads.rs` (+97 -11) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+2 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+7 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+1 -1) 📝 `crates/horizon-client/src/game/leads.rs` (+46 -15) 📝 `crates/horizon-client/src/game/remote.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/leash.rs` (+8 -1) 📝 `crates/horizon-client/src/mobs/world.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/zombie_villager.rs` (+1 -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 Follow-up to #4763. A boat (`AbstractBoat` is `Leashable`) can now be a lead's holder, and the rest of `Entity.interact`'s lead branches match vanilla. ## Rows - `Entity.interact (leash holder)`: sneak-clicking a boat while mobs or boats hang on your lead ties each one that `canHaveALeashAttachedTo` it (not itself, within 12 blocks) to the boat, with the `entity_action` game event and the tied sound. The same sneak click on a mob now goes through one shared `tie_player_leads`. New `Holder::Boat(id)`: mobs tick their pull and snap against it (`MobWorld.leash_boats`), boats do too (`boat_leads.rs`), the rope ends at `getRopeHoldPosition` (position + 0.7 of the 0.5625 eye height), the link packet carries the boat's id, the `leash` tag saves its UUID and restores it after load, and a removed boat drops what hangs on it through the existing holder-gone path. - Rest of `Entity.interact`, compared with mobs and boats: shears now snip every lead on a boat (its own and those hanging on it) and post the `shear` game event; untying posts `entity_interact` (mobs and boats). Cycles are allowed as in vanilla (`canHaveALeashAttachedTo` only rejects `this == entity` and range). - Elastic pull on a ridden boat: no change. `Leashable.tickLeash` runs on the server only, and a boat driven by its rider's client takes that client's position back in `ServerGamePacketListenerImpl.handleMoveVehicle`, so vanilla never moves it by the rope either. Horizon's server copy gets the pull and the rider's client overwrites it the same way. Documented in `boat_leads.rs`. ## Vanilla methods followed `Entity.interact`, `Entity.shearOffAllLeashConnections/dropAllLeashConnections`, `Entity.getRopeHoldPosition`, `Leashable.canHaveALeashAttachedTo/leashableInArea/setLeashedTo/tickLeash`, `ServerGamePacketListenerImpl.handleMoveVehicle`. ## How it was checked `cargo fmt`, `clippy -p horizon-client --all-targets -D warnings`, unit tests for a boat's holder state. 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:22 +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#5843
No description provided.