[PR #1325] [MERGED] Mount inventories for a server's players, and llama inventories #3485

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-mount-inventory


📝 Commits (1)

  • a4e68e6 Mount inventories for a server's players, and llama inventories

📊 Changes

11 files changed (+745 additions, -36 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+14 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+19 -2)
➕ crates/horizon-client/src/game/lan_mount_menu.rs (+222 -0)
📝 crates/horizon-client/src/game/llamas.rs (+2 -1)
📝 crates/horizon-client/src/game/mount_menu.rs (+177 -29)
📝 crates/horizon-client/src/game/remote.rs (+45 -0)
📝 crates/horizon-client/src/lan/containers.rs (+17 -0)
📝 crates/horizon-client/src/lan/hub.rs (+4 -0)
📝 crates/horizon-client/src/menu.rs (+136 -2)
📝 crates/horizon-protocol/src/packets/play.rs (+9 -0)
📝 tools/lan_e2e.py (+100 -2)

📄 Description

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

A server's players can now open a mount's inventory. That covers single player on its server thread, LAN guests and dedicated-server players. Without this, single player would lose the horse inventory as soon as #1265 makes the server thread the default.

Follows #1314 (riding animals for a server's players), merged.

What

  • Opening: shift + use on a tamed horse, donkey, mule, camel or llama, or the inventory key while riding one, opens HorseInventoryMenu.
    • The server sends ClientboundMountScreenOpenPacket: the window id, the chest's columns and the mount.
    • The inventory key sends ServerboundPlayerCommandPacket OPEN_INVENTORY, as vanilla's isServerControlledInventory does.
  • Slots: the saddle, the body slot (horse armour, or a llama's carpet), then a chest. Donkeys and mules get 5 columns, llamas get strength columns.
    • Clicks run on the menu engine's new Kind::Mount.
    • The saddle and body slots are ArmorSlots: isEquippableInSlot for the mount's entity type, one item each.
    • Shift-clicks follow AbstractMountInventoryMenu.quickMoveStack: armour, then the saddle, then the chest, else between the hotbar and the inventory.
  • Server: the slots go back to the mount, with the item's equip sound.
    • The client gets the menu's content after each change (broadcastChanges).
    • The menu closes when the mount dies or is out of reach (stillValid).
    • A carried stack goes back to the inventory when the menu closes.
  • Client: shows a server's mount screen and predicts its clicks with the same engine. The server corrects anything it predicted wrong.
  • Llamas in the window: before, shift + use on a tamed llama did nothing ("not available yet"). Llamas now have their inventory in single player without the server thread too: the carpet slot, their chest, and no saddle slot.

How tested (Mac mini)

  • New lan_e2e mounts: passes with and without --server-thread. The host and a guest each:
    • open a tamed horse's, donkey's and llama's inventory with shift + right click;
    • shift-click in a saddle and iron horse armour (horse), a saddle and dirt into the chest (donkey), or a carpet and dirt into the chest (llama);
    • close the inventory: the server's clear … 0 counts none of those items left;
    • ride the mount and open the inventory with E: the server's content shows each item in its slot.
  • New unit test: menu::tests::mount_menu_slots_take_what_the_mount_wears.
    • A donkey's body slot refuses horse armour, which goes to the chest instead.
    • The saddle goes in the saddle slot and comes back out to the hotbar's end.
    • Without a chest, dirt moves between the hotbar and the inventory.
  • 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 (1022 + 95 + 69 + 47 + smaller suites).
  • tools/parity.py --changed origin/main at a4e68e6a: all 102 harnesses that depend on the changed files pass.

Notes

  • Body armour components: the mount keeps its body item as an item id (extra.head), as before. A dyed leather horse armour's colour or an enchantment on it doesn't survive the trip through the menu. That limit predates this PR.
  • Vanilla server: the client also handles ClientboundMountScreenOpenPacket from a vanilla server. If the packet names an entity that isn't a horse or llama, the window is closed again.

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/1325 **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-mount-inventory` --- ### 📝 Commits (1) - [`a4e68e6`](https://github.com/horizon-rust/horizon/commit/a4e68e6a53a9ac54773cd13cd31e182a993890c5) Mount inventories for a server's players, and llama inventories ### 📊 Changes **11 files changed** (+745 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+14 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+19 -2) ➕ `crates/horizon-client/src/game/lan_mount_menu.rs` (+222 -0) 📝 `crates/horizon-client/src/game/llamas.rs` (+2 -1) 📝 `crates/horizon-client/src/game/mount_menu.rs` (+177 -29) 📝 `crates/horizon-client/src/game/remote.rs` (+45 -0) 📝 `crates/horizon-client/src/lan/containers.rs` (+17 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+4 -0) 📝 `crates/horizon-client/src/menu.rs` (+136 -2) 📝 `crates/horizon-protocol/src/packets/play.rs` (+9 -0) 📝 `tools/lan_e2e.py` (+100 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A server's players can now open a mount's inventory. That covers single player on its server thread, LAN guests and dedicated-server players. Without this, single player would lose the horse inventory as soon as #1265 makes the server thread the default. **Follows #1314** (riding animals for a server's players), merged. ## What - **Opening:** shift + use on a tamed horse, donkey, mule, camel or llama, or the inventory key while riding one, opens `HorseInventoryMenu`. - The server sends `ClientboundMountScreenOpenPacket`: the window id, the chest's columns and the mount. - The inventory key sends `ServerboundPlayerCommandPacket` OPEN_INVENTORY, as vanilla's `isServerControlledInventory` does. - **Slots:** the saddle, the body slot (horse armour, or a llama's carpet), then a chest. Donkeys and mules get 5 columns, llamas get `strength` columns. - Clicks run on the menu engine's new `Kind::Mount`. - The saddle and body slots are `ArmorSlot`s: `isEquippableInSlot` for the mount's entity type, one item each. - Shift-clicks follow `AbstractMountInventoryMenu.quickMoveStack`: armour, then the saddle, then the chest, else between the hotbar and the inventory. - **Server:** the slots go back to the mount, with the item's equip sound. - The client gets the menu's content after each change (`broadcastChanges`). - The menu closes when the mount dies or is out of reach (`stillValid`). - A carried stack goes back to the inventory when the menu closes. - **Client:** shows a server's mount screen and predicts its clicks with the same engine. The server corrects anything it predicted wrong. - **Llamas in the window:** before, shift + use on a tamed llama did nothing ("not available yet"). Llamas now have their inventory in single player without the server thread too: the carpet slot, their chest, and no saddle slot. ## How tested (Mac mini) - **New lan_e2e `mounts`:** passes with and without `--server-thread`. The host and a guest each: - open a tamed horse's, donkey's and llama's inventory with shift + right click; - shift-click in a saddle and iron horse armour (horse), a saddle and dirt into the chest (donkey), or a carpet and dirt into the chest (llama); - close the inventory: the server's `clear … 0` counts none of those items left; - ride the mount and open the inventory with E: the server's content shows each item in its slot. - **New unit test:** `menu::tests::mount_menu_slots_take_what_the_mount_wears`. - A donkey's body slot refuses horse armour, which goes to the chest instead. - The saddle goes in the saddle slot and comes back out to the hotbar's end. - Without a chest, dirt moves between the hotbar and the inventory. - `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 (1022 + 95 + 69 + 47 + smaller suites). - `tools/parity.py --changed origin/main` at a4e68e6a: all 102 harnesses that depend on the changed files pass. ## Notes - **Body armour components:** the mount keeps its body item as an item id (`extra.head`), as before. A dyed leather horse armour's colour or an enchantment on it doesn't survive the trip through the menu. That limit predates this PR. - **Vanilla server:** the client also handles `ClientboundMountScreenOpenPacket` from a vanilla server. If the packet names an entity that isn't a horse or llama, the window is closed again. ## 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:53 +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#3485
No description provided.