[PR #5945] [MERGED] Evokers and illusioners show hand particles while casting #6577

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

📋 Pull Request Information

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

Base: main ← Head: fix/spellcaster-hand-particles


📝 Commits (1)

  • ce65bf2 Evokers and illusioners show hand particles while casting

📊 Changes

7 files changed (+113 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+10 -0)
📝 crates/horizon-client/src/game/remote.rs (+6 -2)
📝 crates/horizon-client/src/mobs.rs (+6 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+3 -0)
📝 crates/horizon-client/src/mobs/illager.rs (+84 -1)
📝 crates/horizon-client/src/mobs/illusioner.rs (+3 -2)
📝 crates/horizon-client/src/mobs/riders.rs (+1 -1)

📄 Description

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

What and why

While a spell is cast, evokers and illusioners now draw two entity_effect particles at their hands, in the spell's colour, on the local world and on guests of a LAN or served world.

  • mobs/illager.rs: cast_particles (the formulas above, Mth table sin/cos, getScale) and the colour table; unit test.
  • mobs.rs, game/creatures.rs: a MobEvent::ParticleColored event, since ParticleAt cannot carry a colour.
  • Called from the local mob tick (mobs/ai.rs) and the remote mob client tick (game/remote.rs), which reads the synced casting byte, so guests see them.
  • Also fixes the illusioner spell ids, which were swapped: the mirror spell is 4 (DISAPPEAR) and blindness is 5, so the casting byte sent to guests now matches vanilla.

Fixes #5886

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

26.3 client jar, bytecode:

  • SpellcasterIllager.tick(): on the client, while isCastingSpell() (entity data DATA_SPELL_CASTING_ID > 0), angle = yBodyRot * 0.017453292f + Mth.cos(tickCount * 0.6662f) * 0.25f; d = 0.6 * getScale(), h = 1.8 * getScale(); addParticle(ColorParticleOption.create(ENTITY_EFFECT, r, g, b), x + cos*d, y + h, z + sin*d, 0, 0, 0) and the same at x - cos*d, z - sin*d. Velocity is three dconst_0 (checked in the bytecode, offsets 157-159).
  • SpellcasterIllager$IllagerSpell.<clinit> (id; r, g, b): NONE 0; SUMMON_VEX 1 (0.7, 0.7, 0.8); FANGS 2 (0.4, 0.3, 0.35); WOLOLO 3 (0.7, 0.5, 0.2); DISAPPEAR 4 (0.3, 0.3, 0.8); BLINDNESS 5 (0.1, 0.1, 0.2).
  • Illusioner$IllusionerMirrorSpellGoal.getSpell() returns DISAPPEAR; IllusionerBlindnessSpellGoal.getSpell() returns BLINDNESS.

Test: casting_evoker and illusioner unit tests. Not checked in a running game or with a second client.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at f8d5d60c0, 3 min 16 s)

Check Result
Scope ✅ 8 files, +113 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (21 s)
rustfmt ✅ (7 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ❌ failed; likely the old Rust above (16 s)
tests: horizon-client ✅ 1688 passed (2 min 26 s)
doc tests ✅ 0 passed (3 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 ➖ 319 affected, to run in CI (--quick): arrow, auto_jump, block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen and 307 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The clippy failure comes from an existing warning at horizon-world/src/block_state_properties.rs:161, a file this PR doesn't touch; it may be down to the older local Rust noted above. CI's result decides.

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/5945 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/spellcaster-hand-particles` --- ### 📝 Commits (1) - [`ce65bf2`](https://github.com/horizon-rust/horizon/commit/ce65bf2fd88d6ec075226296952159c2ff5d4348) Evokers and illusioners show hand particles while casting ### 📊 Changes **7 files changed** (+113 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+10 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -2) 📝 `crates/horizon-client/src/mobs.rs` (+6 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/illager.rs` (+84 -1) 📝 `crates/horizon-client/src/mobs/illusioner.rs` (+3 -2) 📝 `crates/horizon-client/src/mobs/riders.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why While a spell is cast, evokers and illusioners now draw two `entity_effect` particles at their hands, in the spell's colour, on the local world and on guests of a LAN or served world. - `mobs/illager.rs`: `cast_particles` (the formulas above, `Mth` table sin/cos, `getScale`) and the colour table; unit test. - `mobs.rs`, `game/creatures.rs`: a `MobEvent::ParticleColored` event, since `ParticleAt` cannot carry a colour. - Called from the local mob tick (`mobs/ai.rs`) and the remote mob client tick (`game/remote.rs`), which reads the synced casting byte, so guests see them. - Also fixes the illusioner spell ids, which were swapped: the mirror spell is 4 (DISAPPEAR) and blindness is 5, so the casting byte sent to guests now matches vanilla. Fixes #5886 ## Kind - [x] 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 26.3 client jar, bytecode: - `SpellcasterIllager.tick()`: on the client, while `isCastingSpell()` (entity data `DATA_SPELL_CASTING_ID` > 0), `angle = yBodyRot * 0.017453292f + Mth.cos(tickCount * 0.6662f) * 0.25f`; `d = 0.6 * getScale()`, `h = 1.8 * getScale()`; `addParticle(ColorParticleOption.create(ENTITY_EFFECT, r, g, b), x + cos*d, y + h, z + sin*d, 0, 0, 0)` and the same at `x - cos*d, z - sin*d`. Velocity is three `dconst_0` (checked in the bytecode, offsets 157-159). - `SpellcasterIllager$IllagerSpell.<clinit>` (id; r, g, b): NONE 0; SUMMON_VEX 1 (0.7, 0.7, 0.8); FANGS 2 (0.4, 0.3, 0.35); WOLOLO 3 (0.7, 0.5, 0.2); DISAPPEAR 4 (0.3, 0.3, 0.8); BLINDNESS 5 (0.1, 0.1, 0.2). - `Illusioner$IllusionerMirrorSpellGoal.getSpell()` returns DISAPPEAR; `IllusionerBlindnessSpellGoal.getSpell()` returns BLINDNESS. Test: `casting_evoker` and `illusioner` unit tests. Not checked in a running game or with a second client. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at f8d5d60c0, 3 min 16 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +113 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (21 s) | | rustfmt | ✅ (7 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ❌ failed; likely the old Rust above (16 s) | | tests: horizon-client | ✅ 1688 passed (2 min 26 s) | | doc tests | ✅ 0 passed (3 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 | ➖ 319 affected, to run in CI (--quick): arrow, auto_jump, block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen and 307 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The clippy failure comes from an existing warning at `horizon-world/src/block_state_properties.rs:161`, a file this PR doesn't touch; it may be down to the older local Rust noted above. CI's result decides. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:18 +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#6577
No description provided.