[PR #2101] [MERGED] Server players: chest minecart and chest boat menus stay open #4007

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-thread-chest-minecart


📝 Commits (1)

  • 1f51e3d Server players: chest minecart and chest boat menus stay open

📊 Changes

3 files changed (+42 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+34 -1)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -1)
📝 crates/horizon-client/src/lan/menu.rs (+7 -1)

📄 Description

What and why

On the server thread (single player's default) and for LAN guests, right-clicking a chest minecart or a chest boat did nothing: the menu closed the same tick it opened. Ludovic noted it while checking #1974.

The click itself works: the server opens the cart and hands the menu to the player. But a vehicle's items are kept under a placeholder block-entity key far outside the world (CART_KEY_Y), and lan_containers_tick checked the player's reach to that key as if it were a block, so it always found them out of reach and closed the menu.

Now Slots::still_valid skips the block reach check for vehicle keys, and lan_containers_tick checks the vehicle instead, as vanilla does: the cart or boat must still exist and its box must be within the player's entity interaction range plus 4 (3 in survival, 5 in creative). CART_KEY_Y moves to lan::menu::VEHICLE_KEY_Y so the hub can see it.

Checked in game on the server thread: summon a chest minecart, right-click it in survival, the chest menu opens and stays open (before: nothing happened).

Vanilla reference

  • ContainerEntity.isChestVehicleStillValid: !isRemoved() && player.isWithinEntityInteractionRange(getBoundingBox(), 4.0)
  • ServerPlayer.tick: containerMenu.stillValid(this) closes the menu otherwise

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/2101 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-thread-chest-minecart` --- ### 📝 Commits (1) - [`1f51e3d`](https://github.com/horizon-rust/horizon/commit/1f51e3d18cbe71672bb6a1005b3091624feb77e7) Server players: chest minecart and chest boat menus stay open ### 📊 Changes **3 files changed** (+42 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+34 -1) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -1) 📝 `crates/horizon-client/src/lan/menu.rs` (+7 -1) </details> ### 📄 Description ## What and why On the server thread (single player's default) and for LAN guests, right-clicking a chest minecart or a chest boat did nothing: the menu closed the same tick it opened. Ludovic noted it while checking #1974. The click itself works: the server opens the cart and hands the menu to the player. But a vehicle's items are kept under a placeholder block-entity key far outside the world (`CART_KEY_Y`), and `lan_containers_tick` checked the player's reach to that key as if it were a block, so it always found them out of reach and closed the menu. Now `Slots::still_valid` skips the block reach check for vehicle keys, and `lan_containers_tick` checks the vehicle instead, as vanilla does: the cart or boat must still exist and its box must be within the player's entity interaction range plus 4 (3 in survival, 5 in creative). `CART_KEY_Y` moves to `lan::menu::VEHICLE_KEY_Y` so the hub can see it. Checked in game on the server thread: summon a chest minecart, right-click it in survival, the chest menu opens and stays open (before: nothing happened). ## Vanilla reference - `ContainerEntity.isChestVehicleStillValid`: `!isRemoved() && player.isWithinEntityInteractionRange(getBoundingBox(), 4.0)` - `ServerPlayer.tick`: `containerMenu.stillValid(this)` closes the menu otherwise ## 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:13:59 +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#4007
No description provided.