[PR #5667] [MERGED] Test: phantom pane-bite parity cases (#4928) #6426

Closed
opened 2026-11-03 06:20:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5667
Author: @JustKarkat
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/phantom-glass-panes


📝 Commits (2)

  • a23b218 Test: phantom pane-bite parity for #4928
  • eb837f2 Fix: BlockStateId is Copy, drop the pane clone

📊 Changes

1 file changed (+102 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/mobs/phantom.rs (+102 -0)

📄 Description

What

Two test-only parity cases for #4928 (no behaviour change), pinning how the phantom's swoop interacts with glass panes — both mirroring vanilla 26.3:

  • a_phantom_bites_a_player_pressed_behind_a_foot_high_pane_wall — a phantom whose eye-ray passes over a foot-high pane wall keeps the player as a target, and its swoop bites the player pressed against the far face: the boxes are only the pane's 0.125 thickness apart, and the bite is a plain box check (getBoundingBox().inflate(0.2).intersects(target), PhantomSweepAttackGoal.tick — no line-of-sight, no block test; verified against the 26.3 server jar bytecode).
  • a_phantom_cannot_target_a_player_behind_a_window_of_panes — behind a window-height pane wall the eye-ray is blocked by the pane strip, so PhantomAttackPlayerTargetGoal never takes the player (TargetingConditions' line of sight, re-checked every tick in canContinueToUse). That gate is what protects a pane-hidden player; the bite check alone would reach through the pane.

Why

#4928 reports phantoms damaging a player "through glass panes". Horizon's implementation (crates/horizon-client/src/mobs/phantom.rs, SweepAttack::tick and the targeting goals) matches vanilla 26.3 bytecode line for line on every mechanism involved — bite check, targeting LOS gate, sweep continuing without LOS, and movement collision clipping at the pane's shape. In both games:

  • a window of panes protects the player behind it (targeting drops the moment the eye-ray is blocked);
  • a phantom above or around the wall, a foot-high wall, or gaps between unconnected panes leave the eye-ray clear, and the bite lands — the boxes only need inflate(0.2) to reach across a 0.125 pane.

So the report's scenario is vanilla behaviour; the observed hits almost certainly came from geometry where the eye-ray cleared the panes (open top, low wall, or pane gaps), where vanilla bites through too.

Testing

  • Both new cases pass, plus the existing a_phantom_cannot_target_a_player_it_cannot_see (cargo test -p horizon-client --lib phantom: 4 passed).
  • Live check on a vanilla 26.3 dedicated server (26.3 jar, RCON-driven): sealed pane enclosure and a 3-high pane wall with the player pressed against it — phantom circled, never bit, health 20.0 throughout.

Refs #4928


🔄 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/5667 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/phantom-glass-panes` --- ### 📝 Commits (2) - [`a23b218`](https://github.com/horizon-rust/horizon/commit/a23b218ae09e8f4000245d86a92b09b0711feb8b) Test: phantom pane-bite parity for #4928 - [`eb837f2`](https://github.com/horizon-rust/horizon/commit/eb837f2edf4d7345f3c9cc67c90379a6af5563f2) Fix: BlockStateId is Copy, drop the pane clone ### 📊 Changes **1 file changed** (+102 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/phantom.rs` (+102 -0) </details> ### 📄 Description ## What Two test-only parity cases for #4928 (no behaviour change), pinning how the phantom's swoop interacts with glass panes — both mirroring vanilla 26.3: - **`a_phantom_bites_a_player_pressed_behind_a_foot_high_pane_wall`** — a phantom whose eye-ray passes **over** a foot-high pane wall keeps the player as a target, and its swoop bites the player pressed against the far face: the boxes are only the pane's 0.125 thickness apart, and the bite is a plain box check (`getBoundingBox().inflate(0.2).intersects(target)`, `PhantomSweepAttackGoal.tick` — no line-of-sight, no block test; verified against the 26.3 server jar bytecode). - **`a_phantom_cannot_target_a_player_behind_a_window_of_panes`** — behind a window-height pane wall the eye-ray is blocked by the pane strip, so `PhantomAttackPlayerTargetGoal` never takes the player (`TargetingConditions`' line of sight, re-checked every tick in `canContinueToUse`). That gate is what protects a pane-hidden player; the bite check alone would reach through the pane. ## Why #4928 reports phantoms damaging a player "through glass panes". Horizon's implementation (`crates/horizon-client/src/mobs/phantom.rs`, `SweepAttack::tick` and the targeting goals) matches vanilla 26.3 bytecode line for line on every mechanism involved — bite check, targeting LOS gate, sweep continuing without LOS, and movement collision clipping at the pane's shape. In both games: - a **window** of panes protects the player behind it (targeting drops the moment the eye-ray is blocked); - a phantom **above or around** the wall, a **foot-high** wall, or **gaps between unconnected panes** leave the eye-ray clear, and the bite lands — the boxes only need `inflate(0.2)` to reach across a 0.125 pane. So the report's scenario is vanilla behaviour; the observed hits almost certainly came from geometry where the eye-ray cleared the panes (open top, low wall, or pane gaps), where vanilla bites through too. ## Testing - Both new cases pass, plus the existing `a_phantom_cannot_target_a_player_it_cannot_see` (`cargo test -p horizon-client --lib phantom`: 4 passed). - Live check on a vanilla 26.3 dedicated server (26.3 jar, RCON-driven): sealed pane enclosure and a 3-high pane wall with the player pressed against it — phantom circled, never bit, health 20.0 throughout. Refs #4928 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:20:23 +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#6426
No description provided.