[PR #4823] [MERGED] Spectator cameras on more entities, camera spectators hidden from spectators #5873

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

📋 Pull Request Information

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

Base: main ← Head: parity/R2-cam


📝 Commits (1)

  • 434577c Spectator cameras on projectiles, dragon parts, TNT and falling blocks; hide camera spectators from spectators

📊 Changes

7 files changed (+135 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+10 -0)
📝 crates/horizon-client/src/game/lan_camera.rs (+63 -1)
📝 crates/horizon-client/src/game/lan_entities.rs (+1 -0)
📝 crates/horizon-client/src/lan/entity.rs (+55 -2)
📝 crates/horizon-client/src/lan/guest.rs (+3 -0)
📝 crates/horizon-client/src/lan/hub.rs (+2 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)

📄 Description

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

Part of #3520

Rows

  • ServerGamePacketListenerImpl.handleSpectatorAction (follow-up): finishes what #4804 left out.
    • Camera targets, by vanilla's Entity.isPickable overrides: projectiles in #redirectable_projectile (large fireball, wind charge, breeze wind charge) and shulker bullets (an arrow, trident, snowball... are not pickable); primed TNT and falling blocks (!isRemoved); ender dragon parts (EnderDragonPart.isPickable is true, found through ServerLevel.getEntityOrPart; the dragon itself is not pickable). The camera follows each one every tick (ServerPlayer.tick); parts never turn.
    • ServerPlayer.broadcastToPlayer: a spectator who has a camera (getCamera() != this) is no longer tracked by other spectators (lan::entity::broadcast_to_player; a non-spectator never saw a spectator). The tracker checks the pairs again when the camera starts or ends.
  • Not covered: resetLastActionTime (no idle-timeout use for a hosted guest).

Vanilla followed

ServerGamePacketListenerImpl.handleSpectatorAction, ServerLevel.getEntityOrPart, ServerPlayer.broadcastToPlayer/setCamera/tick, Projectile/ShulkerBullet/AbstractArrow/PrimedTnt/FallingBlockEntity/EnderDragonPart/EnderDragon.isPickable, ChunkMap.TrackedEntity.updatePlayer.

Tests

lan::entity::tests::a_spectator_with_a_camera_is_hidden_from_spectators. fmt, clippy -D warnings clean. Not run: harnesses (CI).

🤖 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/4823 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/R2-cam` --- ### 📝 Commits (1) - [`434577c`](https://github.com/horizon-rust/horizon/commit/434577c913485ba42c5517bf5b4cf9571f460321) Spectator cameras on projectiles, dragon parts, TNT and falling blocks; hide camera spectators from spectators ### 📊 Changes **7 files changed** (+135 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+10 -0) 📝 `crates/horizon-client/src/game/lan_camera.rs` (+63 -1) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+1 -0) 📝 `crates/horizon-client/src/lan/entity.rs` (+55 -2) 📝 `crates/horizon-client/src/lan/guest.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+2 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 ## Rows - `ServerGamePacketListenerImpl.handleSpectatorAction (follow-up)`: finishes what #4804 left out. - Camera targets, by vanilla's `Entity.isPickable` overrides: projectiles in `#redirectable_projectile` (large fireball, wind charge, breeze wind charge) and shulker bullets (an arrow, trident, snowball... are not pickable); primed TNT and falling blocks (`!isRemoved`); ender dragon parts (`EnderDragonPart.isPickable` is true, found through `ServerLevel.getEntityOrPart`; the dragon itself is not pickable). The camera follows each one every tick (`ServerPlayer.tick`); parts never turn. - `ServerPlayer.broadcastToPlayer`: a spectator who has a camera (`getCamera() != this`) is no longer tracked by other spectators (`lan::entity::broadcast_to_player`; a non-spectator never saw a spectator). The tracker checks the pairs again when the camera starts or ends. - Not covered: `resetLastActionTime` (no idle-timeout use for a hosted guest). ## Vanilla followed `ServerGamePacketListenerImpl.handleSpectatorAction`, `ServerLevel.getEntityOrPart`, `ServerPlayer.broadcastToPlayer/setCamera/tick`, `Projectile/ShulkerBullet/AbstractArrow/PrimedTnt/FallingBlockEntity/EnderDragonPart/EnderDragon.isPickable`, `ChunkMap.TrackedEntity.updatePlayer`. ## Tests `lan::entity::tests::a_spectator_with_a_camera_is_hidden_from_spectators`. fmt, clippy -D warnings clean. Not run: harnesses (CI). 🤖 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:35 +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#5873
No description provided.