[PR #6407] [MERGED] A player's thrown trident fires the projectile impact hook #6854

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

📋 Pull Request Information

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

Base: main ← Head: fix/6366-projectile-impact-gaps


📝 Commits (2)

  • 2b4b7d0 A player's thrown trident fires the projectile impact hook
  • 05c7ec1 The trident probe reads clip_block_stop's face too

📊 Changes

4 files changed (+95 additions, -16 deletions)

View changed files

📝 crates/horizon-client/examples/probe/trident_probe.rs (+1 -1)
📝 crates/horizon-client/src/arrows.rs (+8 -3)
📝 crates/horizon-client/src/game/native_projectiles.rs (+55 -8)
📝 crates/horizon-client/src/game/trident.rs (+31 -4)

📄 Description

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

What and why

Part of #6366: the second gap, a player's thrown trident never firing native_projectile_impact (#6279).

The hook's doc comment lists tridents among what it covers, but a trident a player throws flies in tick_tridents (game/trident.rs), not tick_projectiles, and never called it.

Now tick_tridents asks the mods about both of its hits, through a new native_trident_impact next to the other impact plumbing in native_projectiles.rs (same owner and entity rules: the thrower is the guest or the host, a dragon part is the dragon):

  • A mob hit: the hit mob, at the trident's position. Canceled: no damage, Channeling, sound or deflection; the trident flies on.
  • A block hit: the block, the face it was hit on, and the stop point. clip_block_stop now also returns the face normal (BlockHit::direction.normal()); the trident was its only caller. Canceled: the trident doesn't stick, isn't heard and keeps its velocity; it stays at the stop point, as the doc comment says an arrow does.

It does nothing unless a mod hears impacts (native_hears_impacts, server-side only), as for the other projectiles. native_impact_owner's player lookup moved into native_thrower so both share it.

Not done here: the first gap (a canceled arrow still sticks). The doc comment promises both that a canceled arrow "does not stick" and that it "stays where it would have hit". At that point the next tick's vanilla in-block check (arrows.rs, collision_boxes(..).contains(at)) sets in_ground, so the two can't both hold. Letting the arrow fly on through the block, as the issue wants, changes what a cancel means for arrows. That's a decision for whoever owns the hook, so I left it.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

NeoForge's ProjectileImpactEvent, posted from AbstractArrow.tick (a trident is an AbstractArrow) before the hit acts. Not run in game here: the issue's check needs horizon-machine-sample logging native_projectile_impact while throwing a trident at a mob and a block.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at 80dfb5f35, 3 min 29 s)

Check Result
Scope ✅ 4 files, +95 −16
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (2 min 55 s)
rustfmt ✅ (15 s)
clippy ✅ (9 s)
tests: horizon-client, horizon-client-lib ❌ 571 passed, 2 failed (1 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The two failing tests, native_loot_kinds_stay_hookable and native_breathing_stays_hookable, are unrelated: they read a source file with include_str! and look for " } ", which a Windows core.autocrlf checkout doesn't have (#6372, fixed in #6375). CI (LF) is unaffected.

🤖 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/6407 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6366-projectile-impact-gaps` --- ### 📝 Commits (2) - [`2b4b7d0`](https://github.com/horizon-rust/horizon/commit/2b4b7d06f383b144eae93df3f4538c9343c4f8b8) A player's thrown trident fires the projectile impact hook - [`05c7ec1`](https://github.com/horizon-rust/horizon/commit/05c7ec158f327e1dbc2f37b5990c056490a1a9a0) The trident probe reads clip_block_stop's face too ### 📊 Changes **4 files changed** (+95 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/trident_probe.rs` (+1 -1) 📝 `crates/horizon-client/src/arrows.rs` (+8 -3) 📝 `crates/horizon-client/src/game/native_projectiles.rs` (+55 -8) 📝 `crates/horizon-client/src/game/trident.rs` (+31 -4) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Part of #6366: the second gap, a player's thrown trident never firing `native_projectile_impact` (#6279). The hook's doc comment lists tridents among what it covers, but a trident a player throws flies in `tick_tridents` (`game/trident.rs`), not `tick_projectiles`, and never called it. Now `tick_tridents` asks the mods about both of its hits, through a new `native_trident_impact` next to the other impact plumbing in `native_projectiles.rs` (same owner and entity rules: the thrower is the guest or the host, a dragon part is the dragon): - **A mob hit:** the hit mob, at the trident's position. Canceled: no damage, Channeling, sound or deflection; the trident flies on. - **A block hit:** the block, the face it was hit on, and the stop point. `clip_block_stop` now also returns the face normal (`BlockHit::direction.normal()`); the trident was its only caller. Canceled: the trident doesn't stick, isn't heard and keeps its velocity; it stays at the stop point, as the doc comment says an arrow does. It does nothing unless a mod hears impacts (`native_hears_impacts`, server-side only), as for the other projectiles. `native_impact_owner`'s player lookup moved into `native_thrower` so both share it. **Not done here: the first gap (a canceled arrow still sticks).** The doc comment promises both that a canceled arrow "does not stick" and that it "stays where it would have hit". At that point the next tick's vanilla in-block check (`arrows.rs`, `collision_boxes(..).contains(at)`) sets `in_ground`, so the two can't both hold. Letting the arrow fly on through the block, as the issue wants, changes what a cancel means for arrows. That's a decision for whoever owns the hook, so I left it. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference NeoForge's `ProjectileImpactEvent`, posted from `AbstractArrow.tick` (a trident is an `AbstractArrow`) before the hit acts. Not run in game here: the issue's check needs horizon-machine-sample logging `native_projectile_impact` while throwing a trident at a mob and a block. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at 80dfb5f35, 3 min 29 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +95 −16 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (2 min 55 s) | | rustfmt | ✅ (15 s) | | clippy | ✅ (9 s) | | tests: horizon-client, horizon-client-lib | ❌ 571 passed, 2 failed (1 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The two failing tests, `native_loot_kinds_stay_hookable` and `native_breathing_stays_hookable`, are unrelated: they read a source file with `include_str!` and look for `" } "`, which a Windows `core.autocrlf` checkout doesn't have (#6372, fixed in #6375). CI (LF) is unaffected. 🤖 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 06:28:07 +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#6854
No description provided.