[PR #2396] [MERGED] Show the crosshair to spectators over containers, stations and portals #4275

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

📋 Pull Request Information

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

Base: main ← Head: fix/spectator-crosshair


📝 Commits (2)

  • c746264 Show the crosshair to spectators over containers, stations and portals
  • db985f7 Spectator crosshair also checks the other half of a double chest

📊 Changes

2 files changed (+64 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -1)
📝 crates/horizon-client/src/game/hand.rs (+59 -1)

📄 Description

What and why

Spectators never saw a crosshair. In vanilla it shows when the view rests on something a spectator can open: an entity that is a menu provider (a chest or hopper minecart, a chest boat) or a block that has a menu (crafting table, chest, furnace, hopper, beacon and so on) or is a portal. Horizon now draws it in those cases, using the same nearest-hit order as the picking code (an entity in front of the block wins). A chest under a redstone conductor shows no crosshair, as in vanilla. A cat sitting on the chest is not checked.

Vanilla reference

  • Hud.extractCrosshair: spectators draw it only when canRenderCrosshairForSpectator(hitResult).
  • Hud.canRenderCrosshairForSpectator: entity hit is a MenuProvider, or BlockState.showAsInteractableInSpectatorMode.
  • BlockBehaviour.showAsInteractableInSpectatorMode: getMenuProvider(...) != null or the block is a Portal.
  • BaseEntityBlock.getMenuProvider (container, lectern and beacon block entities), the workstation blocks' own getMenuProvider overrides, and ChestBlock.getMenuProvider (none when blocked).

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/2396 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/spectator-crosshair` --- ### 📝 Commits (2) - [`c746264`](https://github.com/horizon-rust/horizon/commit/c74626448c544dae0101e005eafa4c23fab19981) Show the crosshair to spectators over containers, stations and portals - [`db985f7`](https://github.com/horizon-rust/horizon/commit/db985f717ce34b63566922b7e3d79cc6559d2c73) Spectator crosshair also checks the other half of a double chest ### 📊 Changes **2 files changed** (+64 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -1) 📝 `crates/horizon-client/src/game/hand.rs` (+59 -1) </details> ### 📄 Description ## What and why Spectators never saw a crosshair. In vanilla it shows when the view rests on something a spectator can open: an entity that is a menu provider (a chest or hopper minecart, a chest boat) or a block that has a menu (crafting table, chest, furnace, hopper, beacon and so on) or is a portal. Horizon now draws it in those cases, using the same nearest-hit order as the picking code (an entity in front of the block wins). A chest under a redstone conductor shows no crosshair, as in vanilla. A cat sitting on the chest is not checked. ## Vanilla reference - `Hud.extractCrosshair`: spectators draw it only when `canRenderCrosshairForSpectator(hitResult)`. - `Hud.canRenderCrosshairForSpectator`: entity hit is a `MenuProvider`, or `BlockState.showAsInteractableInSpectatorMode`. - `BlockBehaviour.showAsInteractableInSpectatorMode`: `getMenuProvider(...) != null` or the block is a `Portal`. - `BaseEntityBlock.getMenuProvider` (container, lectern and beacon block entities), the workstation blocks' own `getMenuProvider` overrides, and `ChestBlock.getMenuProvider` (none when blocked). ## 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:16:00 +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#4275
No description provided.