[PR #2441] [MERGED] Draw the swirls of potion effects around players and mobs #4319

Closed
opened 2026-11-03 04:16:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2441
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/effect-swirls


📝 Commits (3)

  • 43d1f4b Draw the swirls of potion effects around players and mobs
  • d7fece5 Keep hideParticles of mob effects: no swirls drawn or sent for them
  • 0ab24d0 Merge main into this branch (resolves the conflict with main)

📊 Changes

7 files changed (+244 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/client_ambient.rs (+118 -1)
📝 crates/horizon-client/src/game/commands/effects.rs (+10 -1)
📝 crates/horizon-client/src/game/lan.rs (+17 -0)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+30 -1)
📝 crates/horizon-client/src/lan/hub.rs (+60 -2)
📝 crates/horizon-client/src/mobs.rs (+6 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+3 -0)

📄 Description

What and why

A player or mob with a potion effect should be wrapped in swirling particles in the effect's colour (faint for beacon effects). Horizon drew none, and its server never sent the synched effect particle list a client draws them from.

Now:

  • The window's own player swirls from its visible effects (the list the server already sends it, or its own in a world in the frame).
  • A Horizon server sends DATA_EFFECT_PARTICLES and DATA_EFFECT_AMBIENCE_ID for its mobs and its guests, and goes back to an empty list when the effects end. The client reads them for mobs and other players, as it would from a vanilla server.
  • Mobs and LAN guests of a world in the frame swirl from their own effects.

The chance per tick, the invisible and ambient slowdowns, the random particle choice and the random spot in the box follow vanilla. The two omens use their own particles, every other effect an entity effect in its colour.

The host player's own effects are not sent to its LAN guests yet (the host state has no effect list); guests' and mobs' are.

Vanilla reference

  • LivingEntity.tickEffects (client branch): one in 4 (15 invisible) times 5 if ambient, Util.getRandom(particles) at getRandomX(0.5), getRandomY(), getRandomZ(0.5) with velocity (1, 1, 1).
  • LivingEntity.updateSynchronizedMobEffectParticles: the particles of visible effects, and areAllEffectsAmbient.
  • MobEffect.particleFactory: ENTITY_EFFECT with ARGB.color(alpha, color) (AMBIENT_ALPHA 38), and the constant TRIAL_OMEN and RAID_OMEN particles.

Self-check

cargo check -p horizon-client passes.


🔄 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/2441 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/effect-swirls` --- ### 📝 Commits (3) - [`43d1f4b`](https://github.com/horizon-rust/horizon/commit/43d1f4b80185a11e405199188a6ba993c520bf42) Draw the swirls of potion effects around players and mobs - [`d7fece5`](https://github.com/horizon-rust/horizon/commit/d7fece582525719a905729232904b3d566090751) Keep hideParticles of mob effects: no swirls drawn or sent for them - [`0ab24d0`](https://github.com/horizon-rust/horizon/commit/0ab24d0805993f78d0a247527625ffcd6a338bdf) Merge main into this branch (resolves the conflict with main) ### 📊 Changes **7 files changed** (+244 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/client_ambient.rs` (+118 -1) 📝 `crates/horizon-client/src/game/commands/effects.rs` (+10 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+17 -0) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+30 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+60 -2) 📝 `crates/horizon-client/src/mobs.rs` (+6 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+3 -0) </details> ### 📄 Description ## What and why A player or mob with a potion effect should be wrapped in swirling particles in the effect's colour (faint for beacon effects). Horizon drew none, and its server never sent the synched effect particle list a client draws them from. Now: - The window's own player swirls from its visible effects (the list the server already sends it, or its own in a world in the frame). - A Horizon server sends `DATA_EFFECT_PARTICLES` and `DATA_EFFECT_AMBIENCE_ID` for its mobs and its guests, and goes back to an empty list when the effects end. The client reads them for mobs and other players, as it would from a vanilla server. - Mobs and LAN guests of a world in the frame swirl from their own effects. The chance per tick, the invisible and ambient slowdowns, the random particle choice and the random spot in the box follow vanilla. The two omens use their own particles, every other effect an entity effect in its colour. The host player's own effects are not sent to its LAN guests yet (the host state has no effect list); guests' and mobs' are. ## Vanilla reference - `LivingEntity.tickEffects` (client branch): one in `4` (`15` invisible) times `5` if ambient, `Util.getRandom(particles)` at `getRandomX(0.5)`, `getRandomY()`, `getRandomZ(0.5)` with velocity `(1, 1, 1)`. - `LivingEntity.updateSynchronizedMobEffectParticles`: the particles of visible effects, and `areAllEffectsAmbient`. - `MobEffect.particleFactory`: `ENTITY_EFFECT` with `ARGB.color(alpha, color)` (`AMBIENT_ALPHA` 38), and the constant `TRIAL_OMEN` and `RAID_OMEN` particles. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:19 +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#4319
No description provided.