[PR #2129] [MERGED] Server players see sweep attacks, damage indicators and fishing particles #4032

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-sent-particles


📝 Commits (1)

  • 6bc8a8b Send sweep, damage indicator and fishing particles to a server's players

📊 Changes

5 files changed (+90 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+16 -6)
📝 crates/horizon-client/src/game/creatures.rs (+9 -0)
📝 crates/horizon-client/src/game/fishing.rs (+2 -0)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_particles.rs (+61 -0)

📄 Description

What and why

Vanilla sends several particles with ServerLevel.sendParticles, so every player nearby sees them. Horizon only drew them into the host window's own particle engine, so a window on a server (including the in-process server single player runs on) and any guest never saw them. Only /particle sent the packet.

  • New lan_send_particles (game/lan_particles.rs): builds one ClientboundLevelParticlesPacket with the call's count, offset and speed and sends it to each player in the level whose block is within 32 blocks. It does not send to the window's own player, so the in-frame drawing is kept as it is and nothing is drawn twice.
  • While the host holds the players (a guest's turn through as_guest, or the host hitting a guest) the call is queued in Creatures::lan_particles and flush_lan_particles sends it at the end of the server tick, so the acting guest and everyone else get it. This is the same idea as the queues for wind bursts and explosions, kept in its own field.
  • Used at these vanilla sites:
    • Player.sweepAttack: sweep_attack (count 0, offset from the player to the particle, speed 0).
    • Player.damageStatsAndHearts: the damage indicator hearts after a player's hit on a mob.
    • FishingHook.catchingFish: the bubble, fishing and splash particles (all go through the hook's send_particles).

Left out: squid and glow squid ink (Squid.spawnInk). Horizon spawns no ink at all today, even in the window, because the squid's hurt behaviour is not implemented, so there is nothing to forward yet.

Vanilla reference

  • ServerLevel.sendParticles: one packet to each player in the level within 32 blocks (512 with overrideLimiter).
  • ClientPacketListener.handleParticleEvent: count 0 is one particle moving by speed times offset; otherwise gaussian offset and speed per particle.
  • Player.sweepAttack, Player.damageStatsAndHearts, FishingHook.catchingFish.

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/2129 **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/server-sent-particles` --- ### 📝 Commits (1) - [`6bc8a8b`](https://github.com/horizon-rust/horizon/commit/6bc8a8b8899fc5be2e6c03485db8b6b9b47ff05d) Send sweep, damage indicator and fishing particles to a server's players ### 📊 Changes **5 files changed** (+90 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+16 -6) 📝 `crates/horizon-client/src/game/creatures.rs` (+9 -0) 📝 `crates/horizon-client/src/game/fishing.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_particles.rs` (+61 -0) </details> ### 📄 Description ## What and why Vanilla sends several particles with `ServerLevel.sendParticles`, so every player nearby sees them. Horizon only drew them into the host window's own particle engine, so a window on a server (including the in-process server single player runs on) and any guest never saw them. Only `/particle` sent the packet. - New `lan_send_particles` (game/lan_particles.rs): builds one `ClientboundLevelParticlesPacket` with the call's count, offset and speed and sends it to each player in the level whose block is within 32 blocks. It does not send to the window's own player, so the in-frame drawing is kept as it is and nothing is drawn twice. - While the host holds the players (a guest's turn through `as_guest`, or the host hitting a guest) the call is queued in `Creatures::lan_particles` and `flush_lan_particles` sends it at the end of the server tick, so the acting guest and everyone else get it. This is the same idea as the queues for wind bursts and explosions, kept in its own field. - Used at these vanilla sites: - `Player.sweepAttack`: `sweep_attack` (count 0, offset from the player to the particle, speed 0). - `Player.damageStatsAndHearts`: the damage indicator hearts after a player's hit on a mob. - `FishingHook.catchingFish`: the bubble, fishing and splash particles (all go through the hook's `send_particles`). Left out: squid and glow squid ink (`Squid.spawnInk`). Horizon spawns no ink at all today, even in the window, because the squid's hurt behaviour is not implemented, so there is nothing to forward yet. ## Vanilla reference - `ServerLevel.sendParticles`: one packet to each player in the level within 32 blocks (512 with `overrideLimiter`). - `ClientPacketListener.handleParticleEvent`: count 0 is one particle moving by speed times offset; otherwise gaussian offset and speed per particle. - `Player.sweepAttack`, `Player.damageStatsAndHearts`, `FishingHook.catchingFish`. ## 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:14:09 +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#4032
No description provided.