[PR #7688] Emit first-tick shoot events for summoned snowballs #7764

Open
opened 2026-11-03 07:23:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7688
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/projectile-first-tick-shoot


📝 Commits (2)

  • ef517d0 Fix first-tick shoot events for summoned projectiles
  • ce18ed4 Merge main and retain first-tick mob projectile notifications

📊 Changes

9 files changed (+301 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+37 -5)
📝 crates/horizon-client/src/game/commands/data.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+28 -2)
📝 crates/horizon-client/src/game/native_projectiles.rs (+5 -1)
📝 crates/horizon-client/src/game/persist.rs (+8 -4)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+3 -1)
📝 crates/horizon-client/src/game/sculk_fixture.rs (+72 -0)
📝 crates/horizon-client/src/projectiles.rs (+54 -0)
➕ tools/test_projectile_shoot.py (+93 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

Fixes #7661. A summoned snowball now emits projectile_shoot on its first tick, so a nearby warden selects that vibration and reacts one tick earlier. HasBeenShot is loaded and saved as explicit state. Normal non-arrow launches use this first-tick notification too, avoiding duplicate launch notifications. A canceled native impact preserves the notification state during replay.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Official 26.3 Projectile.tick, readAdditionalSaveData and addAdditionalSaveData; ThrowableProjectile.tick, AbstractHurtingProjectile.tick, LlamaSpit.tick and ShulkerBullet.tick determine whether the base notification precedes or follows movement. SnowballItem.use and Projectile.spawnProjectile do not dispatch a separate shoot event.

tools/test_projectile_shoot.py runs five scenarios through the real headless game: summoned, explicit false, already shot, player launch and mob launch. It counts actual game-event dispatches, checks the warden selector and entity-event 61 timing, and verifies the reported Java position/distance. The baseline fails 8 assertions; the fixed runtime passes all five scenarios. Unit tests cover first-tick emission and NBT flags independently of entity age. A fresh Java/Horizon differential run remains pending; the runtime expectations follow the supplied Java observations and official bytecode. The separate projectile-land origin discrepancy is outside this change.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at 31f83499b, 8 min 29 s)

Check Result
Scope ✅ 9 files, +301 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 0 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 45 s)
tests: horizon-client, horizon-client-lib ✅ 2209 passed (5 min 22 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (11 s)
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)

🤖 Generated with Codex.


🔄 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/7688 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/projectile-first-tick-shoot` --- ### 📝 Commits (2) - [`ef517d0`](https://github.com/horizon-rust/horizon/commit/ef517d04cb1d52ba75e1ecf97e8209772b1f1430) Fix first-tick shoot events for summoned projectiles - [`ce18ed4`](https://github.com/horizon-rust/horizon/commit/ce18ed43e1beba928acb30146f4a82b8a1e9ebc7) Merge main and retain first-tick mob projectile notifications ### 📊 Changes **9 files changed** (+301 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+37 -5) 📝 `crates/horizon-client/src/game/commands/data.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+28 -2) 📝 `crates/horizon-client/src/game/native_projectiles.rs` (+5 -1) 📝 `crates/horizon-client/src/game/persist.rs` (+8 -4) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+3 -1) 📝 `crates/horizon-client/src/game/sculk_fixture.rs` (+72 -0) 📝 `crates/horizon-client/src/projectiles.rs` (+54 -0) ➕ `tools/test_projectile_shoot.py` (+93 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Fixes #7661. A summoned snowball now emits `projectile_shoot` on its first tick, so a nearby warden selects that vibration and reacts one tick earlier. `HasBeenShot` is loaded and saved as explicit state. Normal non-arrow launches use this first-tick notification too, avoiding duplicate launch notifications. A canceled native impact preserves the notification state during replay. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Official 26.3 `Projectile.tick`, `readAdditionalSaveData` and `addAdditionalSaveData`; `ThrowableProjectile.tick`, `AbstractHurtingProjectile.tick`, `LlamaSpit.tick` and `ShulkerBullet.tick` determine whether the base notification precedes or follows movement. `SnowballItem.use` and `Projectile.spawnProjectile` do not dispatch a separate shoot event. `tools/test_projectile_shoot.py` runs five scenarios through the real headless game: summoned, explicit false, already shot, player launch and mob launch. It counts actual game-event dispatches, checks the warden selector and entity-event 61 timing, and verifies the reported Java position/distance. The baseline fails 8 assertions; the fixed runtime passes all five scenarios. Unit tests cover first-tick emission and NBT flags independently of entity age. A fresh Java/Horizon differential run remains pending; the runtime expectations follow the supplied Java observations and official bytecode. The separate projectile-land origin discrepancy is outside this change. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at 31f83499b, 8 min 29 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +301 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 0 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 45 s) | | tests: horizon-client, horizon-client-lib | ✅ 2209 passed (5 min 22 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (11 s) | | 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) | 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7764
No description provided.