[PR #1314] [MERGED] Riding animals for a server's players (horses, pigs, striders, camels, llamas, happy ghast) #3481

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1314
Author: @ludovic111
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-riding


📝 Commits (1)

  • 525129f Riding animals for a server's players

📊 Changes

8 files changed (+224 additions, -33 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+4 -0)
📝 crates/horizon-client/src/game/lan.rs (+10 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+4 -0)
📝 crates/horizon-client/src/game/lan_vehicles.rs (+24 -4)
📝 crates/horizon-client/src/game/mounts.rs (+29 -19)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+8 -0)
📝 crates/horizon-client/src/mobs/equine.rs (+14 -8)
📝 tools/lan_e2e.py (+131 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Players of a server can now ride animals: single player on its server thread, LAN guests and dedicated-server players. Without this, single player would lose horse riding as soon as #1265 makes the server thread the default. It follows #1280 (boats, minecarts) and #1285 (Play with Friends).

What

  • Covered: horses, donkeys and mules; camels; pigs and striders (steered with a carrot or warped fungus on a stick, including the boost); llamas (you ride but don't steer); the happy ghast (harness, then fly; holding jump rises).
  • Mount and dismount: a right click (an Interact on the animal) mounts. Saddles and harnesses also go on with a right click. Sneaking gets you off: the client gets SetPassengers first, then the teleport beside the animal (dismountTo).
  • Steering, jumping, sprinting: come from the rider's PlayerInput and rotation. The horse jump bar charges per player on the server. The client charges its own bar for the HUD.
  • One rider per animal: an animal another player rides can't be taken or fed (isVehicle).
  • Leftover input: an animal whose rider left the game stops taking its input.
  • Ride camera: the client sits where positionRider puts it on the animal the server sent. That includes the camel's forward seat, the llama's seat and the happy ghast's back.

How

  • Server (lan_vehicles.rs): a server player's animal is its vehicle during that player's turn. Each tick, guest_vehicle_tick runs the window's own tick_mount_riding and position_rider as that player. GuestPlay keeps a per-player MountState (the jump charge), swapped in with the turn.
  • Client (remote_vehicles.rs): when the vehicle is an animal, remote_ride charges the jump bar and seats the player. It sends no MoveVehicle: the animal moves on the server, like a minecart.
  • Difference from vanilla: a vanilla client drives a horse itself and sends MoveVehicle. Here the server drives it from the rider's input. A vanilla client on a Horizon server also sends that input, so it works; on a vanilla server, the Horizon client still can't drive an animal (it never could).
  • Ridden movement fix (pre-existing, also in the window): Mob.setSpeed also sets zza, and the ridden input was set before the speed, so it was lost. Pigs and striders crawled (0.3 blocks in 3 s), and horses kept walking with no key held. The input is now set after the speed, as travelRidden does.
  • Ridden speed: now the effective movement speed (potions, the cold strider's modifier). A shivering strider rides at 0.35 of it (Strider.getRiddenSpeed).
  • mobs control command: now reports ridden, controlled and saddled.

How tested (Mac mini)

  • lan_e2e riding passes with and without --server-thread. The host and a guest each:

    • saddle and ride a horse: about 29 blocks in 3 s of forward, and a 3-block jump from the charged bar;
    • ride a pig (8 blocks) and a strider (6 blocks, cold on stone), each with its stick;
    • ride a camel (6–9 blocks) and a donkey (23 blocks);
    • sit on a llama;
    • harness a happy ghast and rise about 3 blocks holding jump;
    • get off each one by sneaking.

    The other side sees each animal where its rider took it.

  • boats, minecarts, frames, ladder and lightning also pass in both modes.

  • cargo fmt --check and cargo clippy --workspace --all-targets -D warnings are clean.

  • cargo test -p horizon-client -p horizon-protocol -p horizon-server passes (1021 + 94 + 69 + 47 + smaller suites).

  • tools/parity.py --changed origin/main at 525129fb: all 102 harnesses that depend on the changed files pass (101 in the full run; section_mesh failed there only because files under it changed during that run, and the rerun on the unchanged head passed it).

Still missing on the server thread

The horse, donkey and llama inventory screen (ClientboundMountScreenOpenPacket) comes in a follow-up PR stacked on this one.

What needs Ludovic

Nothing.

🤖 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/1314 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-riding` --- ### 📝 Commits (1) - [`525129f`](https://github.com/horizon-rust/horizon/commit/525129fbe681fb4c8393f7f3c1fb9343f568ebd7) Riding animals for a server's players ### 📊 Changes **8 files changed** (+224 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+10 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan_vehicles.rs` (+24 -4) 📝 `crates/horizon-client/src/game/mounts.rs` (+29 -19) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+8 -0) 📝 `crates/horizon-client/src/mobs/equine.rs` (+14 -8) 📝 `tools/lan_e2e.py` (+131 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Players of a server can now ride animals: single player on its server thread, LAN guests and dedicated-server players. Without this, single player would lose horse riding as soon as #1265 makes the server thread the default. It follows #1280 (boats, minecarts) and #1285 (Play with Friends). ## What - **Covered:** horses, donkeys and mules; camels; pigs and striders (steered with a carrot or warped fungus on a stick, including the boost); llamas (you ride but don't steer); the happy ghast (harness, then fly; holding jump rises). - **Mount and dismount:** a right click (an `Interact` on the animal) mounts. Saddles and harnesses also go on with a right click. Sneaking gets you off: the client gets `SetPassengers` first, then the teleport beside the animal (`dismountTo`). - **Steering, jumping, sprinting:** come from the rider's `PlayerInput` and rotation. The horse jump bar charges per player on the server. The client charges its own bar for the HUD. - **One rider per animal:** an animal another player rides can't be taken or fed (`isVehicle`). - **Leftover input:** an animal whose rider left the game stops taking its input. - **Ride camera:** the client sits where `positionRider` puts it on the animal the server sent. That includes the camel's forward seat, the llama's seat and the happy ghast's back. ## How - **Server** (`lan_vehicles.rs`): a server player's animal is its vehicle during that player's turn. Each tick, `guest_vehicle_tick` runs the window's own `tick_mount_riding` and `position_rider` as that player. `GuestPlay` keeps a per-player `MountState` (the jump charge), swapped in with the turn. - **Client** (`remote_vehicles.rs`): when the vehicle is an animal, `remote_ride` charges the jump bar and seats the player. It sends no `MoveVehicle`: the animal moves on the server, like a minecart. - **Difference from vanilla:** a vanilla client drives a horse itself and sends `MoveVehicle`. Here the server drives it from the rider's input. A vanilla client on a Horizon server also sends that input, so it works; on a vanilla server, the Horizon client still can't drive an animal (it never could). - **Ridden movement fix (pre-existing, also in the window):** `Mob.setSpeed` also sets `zza`, and the ridden input was set *before* the speed, so it was lost. Pigs and striders crawled (0.3 blocks in 3 s), and horses kept walking with no key held. The input is now set after the speed, as `travelRidden` does. - **Ridden speed:** now the effective movement speed (potions, the cold strider's modifier). A shivering strider rides at 0.35 of it (`Strider.getRiddenSpeed`). - **`mobs` control command:** now reports `ridden`, `controlled` and `saddled`. ## How tested (Mac mini) - **lan_e2e `riding`** passes with and without `--server-thread`. The host and a guest each: - saddle and ride a horse: about 29 blocks in 3 s of forward, and a 3-block jump from the charged bar; - ride a pig (8 blocks) and a strider (6 blocks, cold on stone), each with its stick; - ride a camel (6–9 blocks) and a donkey (23 blocks); - sit on a llama; - harness a happy ghast and rise about 3 blocks holding jump; - get off each one by sneaking. The other side sees each animal where its rider took it. - `boats`, `minecarts`, `frames`, `ladder` and `lightning` also pass in both modes. - `cargo fmt --check` and `cargo clippy --workspace --all-targets -D warnings` are clean. - `cargo test -p horizon-client -p horizon-protocol -p horizon-server` passes (1021 + 94 + 69 + 47 + smaller suites). - `tools/parity.py --changed origin/main` at 525129fb: all 102 harnesses that depend on the changed files pass (101 in the full run; `section_mesh` failed there only because files under it changed during that run, and the rerun on the unchanged head passed it). ## Still missing on the server thread The horse, donkey and llama inventory screen (`ClientboundMountScreenOpenPacket`) comes in a follow-up PR stacked on this one. ## What needs Ludovic Nothing. 🤖 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 04:09:50 +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#3481
No description provided.