[PR #2442] [MERGED] Burst a breaking potion into item crumbs and coloured spell particles #4322

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

📋 Pull Request Information

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

Base: main ← Head: fix/splash-potion-burst


📝 Commits (2)

  • 18f8a68 Burst a breaking potion into item crumbs and coloured spell particles
  • 54ae097 Merge main into the branch

📊 Changes

3 files changed (+93 additions, -48 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+15 -2)
📝 crates/horizon-client/src/game/level_particles.rs (+63 -0)
📝 crates/horizon-client/src/game/potions.rs (+15 -46)

📄 Description

What and why

A breaking splash potion, lingering potion or experience bottle should burst into eight crumbs of the potion item and a hundred spell particles in the potion's colour, thrown out in a disc, with the splash sound. Horizon spawned only eight terrain crumbs (a block-style crumb of the potion sprite) and played the sound itself, on the world's own side, so a player of a server (including single player on its server thread) saw a few crumbs at most and no coloured burst.

The break now goes out as vanilla's level events, so it reaches every player and draws the same way in the frame, on the server thread and on a LAN host:

  • 2002 (2007 for a potion with an instant effect, such as healing or harming) draws the burst, from the colour in the event's data. An experience bottle sends 2002 with the water colour.
  • 1053 (1054 for instant) plays the splash sound. A lingering potion now plays it too: vanilla has no separate lingering break sound, and the one Horizon asked for does not exist.

Vanilla reference

  • AbstractThrownPotion.onHit: levelEvent(2007 or 2002, blockPosition, potion.getColor()), then levelEvent(1054 or 1053) unless silent.
  • ThrownExperienceBottle.onHit: levelEvent(2002, blockPosition, -13083194) and 1053.
  • LevelEventHandler.potionSplashParticles (2002 EFFECT, 2007 INSTANT_EFFECT): 8 ITEM particles of the splash potion with velocity (gaussian * 0.15, double * 0.2, gaussian * 0.15), then 100 spell particles with dist = double * 4, a random angle, brightness 0.75 + float * 0.25 and power dist.
  • LevelEventHandler 1053 and 1054: SPLASH_POTION_BREAK, volume 1, pitch float * 0.1 + 0.9.

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/2442 **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/splash-potion-burst` --- ### 📝 Commits (2) - [`18f8a68`](https://github.com/horizon-rust/horizon/commit/18f8a6868bb18d843562663835a5298bfdcae1a9) Burst a breaking potion into item crumbs and coloured spell particles - [`54ae097`](https://github.com/horizon-rust/horizon/commit/54ae097faa4e1dd3829992c59f1bad6e07cefc4d) Merge main into the branch ### 📊 Changes **3 files changed** (+93 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+15 -2) 📝 `crates/horizon-client/src/game/level_particles.rs` (+63 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+15 -46) </details> ### 📄 Description ## What and why A breaking splash potion, lingering potion or experience bottle should burst into eight crumbs of the potion item and a hundred spell particles in the potion's colour, thrown out in a disc, with the splash sound. Horizon spawned only eight terrain crumbs (a block-style crumb of the potion sprite) and played the sound itself, on the world's own side, so a player of a server (including single player on its server thread) saw a few crumbs at most and no coloured burst. The break now goes out as vanilla's level events, so it reaches every player and draws the same way in the frame, on the server thread and on a LAN host: - 2002 (2007 for a potion with an instant effect, such as healing or harming) draws the burst, from the colour in the event's data. An experience bottle sends 2002 with the water colour. - 1053 (1054 for instant) plays the splash sound. A lingering potion now plays it too: vanilla has no separate lingering break sound, and the one Horizon asked for does not exist. ## Vanilla reference - `AbstractThrownPotion.onHit`: `levelEvent(2007 or 2002, blockPosition, potion.getColor())`, then `levelEvent(1054 or 1053)` unless silent. - `ThrownExperienceBottle.onHit`: `levelEvent(2002, blockPosition, -13083194)` and 1053. - `LevelEventHandler.potionSplashParticles` (2002 `EFFECT`, 2007 `INSTANT_EFFECT`): 8 `ITEM` particles of the splash potion with velocity `(gaussian * 0.15, double * 0.2, gaussian * 0.15)`, then 100 spell particles with `dist = double * 4`, a random angle, brightness `0.75 + float * 0.25` and power `dist`. - `LevelEventHandler` 1053 and 1054: `SPLASH_POTION_BREAK`, volume 1, pitch `float * 0.1 + 0.9`. ## 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:20 +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#4322
No description provided.