[PR #1117] [MERGED] Thrown potions: drawn as their item, facing the camera (ThrownItemRenderer) #3062

Closed
opened 2026-11-02 16:01:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1117
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/thrown-potion-render


📝 Commits (1)

  • 08fdafc Thrown potions: drawn as their item, facing the camera (ThrownItemRenderer)

📊 Changes

4 files changed (+76 additions, -23 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+9 -0)
📝 crates/horizon-client/src/game/potions.rs (+53 -23)
📝 crates/horizon-client/src/projectiles.rs (+13 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #818. Reported by @Online5277: thrown potions render very strangely.

What and why

Vanilla draws a thrown potion with ThrownItemRenderer: the item's model in the GROUND display context, rotated to face the camera, scale 1, lit at its position; ThrowableProjectile.shouldRenderAtSqrDistance hides it for its first two ticks within 3.5 blocks of the camera. Horizon drew a stack of terrain-particle quads of the bottle instead.

  • thrown_potion_geometry: the potion's item (resolve_item(stack, Ground) with its potion contents) facing the camera, interpolated from the previous tick's position, with the vanilla near-hide rule.
  • Witch potions (Projectile::potion_item) draw the same way, as the matching splash potion.

Screenshots (4 ticks after throwing a splash potion of poison)

main this PR

Self-check (all five B2 branches merged onto one integration commit, Mac mini)

  • On the branches rebased onto origin/main 252f877f:
  • cargo fmt --all -- --check: clean
  • set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • cargo test -p horizon-assets -p horizon-client: all pass (960 + 84 + smaller suites, 0 failed)
  • tools/parity.py --changed origin/main (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (--fresh, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them.
  • Screenshot comparison: main vs this branch from the same world, camera and commands (--offscreen + horizon-ctl screenshot), below.

Needs Ludovic: nothing.

🤖 Generated with Claude Code


🔄 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/1117 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/thrown-potion-render` --- ### 📝 Commits (1) - [`08fdafc`](https://github.com/horizon-rust/horizon/commit/08fdafc4fcb327803a4c6363d02a0f26c24f4418) Thrown potions: drawn as their item, facing the camera (ThrownItemRenderer) ### 📊 Changes **4 files changed** (+76 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+9 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+53 -23) 📝 `crates/horizon-client/src/projectiles.rs` (+13 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #818. Reported by @Online5277: thrown potions render very strangely. ## What and why Vanilla draws a thrown potion with `ThrownItemRenderer`: the item's model in the `GROUND` display context, rotated to face the camera, scale 1, lit at its position; `ThrowableProjectile.shouldRenderAtSqrDistance` hides it for its first two ticks within 3.5 blocks of the camera. Horizon drew a stack of terrain-particle quads of the bottle instead. - `thrown_potion_geometry`: the potion's item (`resolve_item(stack, Ground)` with its potion contents) facing the camera, interpolated from the previous tick's position, with the vanilla near-hide rule. - Witch potions (`Projectile::potion_item`) draw the same way, as the matching splash potion. ## Screenshots (4 ticks after throwing a splash potion of poison) | main | this PR | |---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/818-main.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/818-fix.png) | ## Self-check (all five B2 branches merged onto one integration commit, Mac mini) - On the branches rebased onto origin/main 252f877f: - `cargo fmt --all -- --check`: clean - `set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings`: exit 0 - `cargo test -p horizon-assets -p horizon-client`: all pass (960 + 84 + smaller suites, 0 failed) - `tools/parity.py --changed origin/main` (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (`--fresh`, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them. - Screenshot comparison: main vs this branch from the same world, camera and commands (`--offscreen` + `horizon-ctl screenshot`), below. Needs Ludovic: nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:12 +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#3062
No description provided.