[PR #189] [MERGED] Burning arrows: lava, fire, Flame and what they light (#125, #124) #2390

Closed
opened 2026-11-02 15:55:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/arrow-fire-124


📝 Commits (2)

📊 Changes

14 files changed (+1995 additions, -90 deletions)

View changed files

➕ crates/horizon-client/examples/arrow_probe.rs (+266 -0)
➕ crates/horizon-client/src/arrows.rs (+1025 -0)
📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/creatures.rs (+190 -9)
📝 crates/horizon-client/src/game/enchant_effects.rs (+39 -0)
📝 crates/horizon-client/src/game/minecarts.rs (+34 -8)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/mobs/illager.rs (+1 -1)
📝 crates/horizon-client/src/mobs/undead.rs (+1 -1)
📝 crates/horizon-client/src/motion/fluids.rs (+15 -13)
📝 crates/horizon-client/src/projectiles.rs (+40 -57)
📝 crates/horizon-world/src/entity_fluid.rs (+1 -1)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaArrowOracle.java (+158 -0)
➕ tools/test_arrow_parity.py (+218 -0)

📄 Description

Fixes #125
Fixes #124

Stacked on #187 (arrow port), itself on #186; base is fix/arrow-water-127. Retarget before merging the lower PRs with branch deletion.

Root cause

Arrows had no fire state at all: nothing along their path could ignite them (lava, fire, soul fire), the player's Flame bow did nothing (projectile_spawned ignite was never applied), and only mobs' Flame bows did anything, as a flat 5-second ignite on hit. With no burning arrows, nothing a burning projectile triggers existed either: TNT priming, lighting campfires/candles/candle cakes, blowing up TNT minecarts. Arrows also passed through minecarts.

Fix

  • arrows.rs keeps Entity.remainingFireTicks. The blocks along the path go through InsideBlockEffectApplier.StepBasedCollector in vanilla order: fire and soul fire fireIgnite (8 s; +1 from below zero), lava LAVA_IGNITE (15 s), water EXTINGUISH with its sound. The arrow's fire-immune reset is 0. Fire burns down in flight and not while stuck.
  • Flame: EnchantmentHelper.onProjectileSpawned ignite effects of the held bow (bow_projectile_ignite, read from the enchantment JSON). Mobs' ArrowBonus.flame also ignites the arrow for 100 s at spawn instead of a special case on hit.
  • Projectile.onHitBlock → onProjectileHit for a burning arrow: TNT primes (tnt_explodes; mayInteract = mob_griefing for mobs' arrows), campfires and soul campfires light if dry, candles light if dry, candle cakes light.
  • A burning arrow sets the entity it hits alight for 5 s.
  • Arrows hit minecarts (VehicleEntity.hurt: damage ×10, breaks past 40). A burning arrow explodes a TNT minecart with MinecartTNT.explode(projectile.getDeltaMovement().lengthSqr()).
  • Burning arrows render FlameFeatureRenderer's fire quads (block/fire_0/fire_1, scale = width × 1.4, camera-facing about Y, full block light).

Parity proof

tools/test_arrow_parity.py (vanilla Arrow entities in VanillaArrowOracle vs arrows::tick in examples/arrow_probe.rs) gains the fire corpus: lava pools and lava/water walls (in, through, out, then into water), fire and soul fire curtains, Flame-ignited arrows in flight/stuck/in rain/in water, and burning and cold hits on TNT, campfires (lit, unlit, waterlogged), candles (lit/unlit/waterlogged, 1–4) and candle cakes, checked against the real blocks' onProjectileHit (block state written, TNT entity spawned, primed sound and game event).

  • Mac mini: 105,357 / 105,357 lines on both the client and server jars (rebased on current main).
  • test_native_scene_motion.py 2,499,038 / 2,499,038; cargo clippy --workspace --all-targets -D warnings clean; cargo test -p horizon-client --lib 468 passed.

In-game check

Linux build on a vscreen, survival:

  • Flame bow → unlit campfire: lit. → unlit candle: lit. → TNT: primed and exploded (the pig behind it hurt, then set alight).
  • Plain bow through a lava curtain: the arrow comes out burning. Through a fire curtain: burning, and it lights the candle behind it.
  • Stuck burning arrows keep their flames and fall when the explosion takes their block.
  • Flame bow → TNT minecart: explodes (strong enough to kill the player 10 blocks away, as the arrow speed feeds the power).

Left out / notes

  • give @s bow[enchantments={flame:1}] without a namespace doesn't resolve to minecraft:flame in Horizon's item component parser (vanilla does); /enchant and namespaced ids work. Not part of this change.
  • Only arrows render the fire quads (other burning entities still don't draw flames).
  • Pickup (#119) is the next PR in the stack.

🤖 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/189 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/arrow-fire-124` --- ### 📝 Commits (2) - [`1d93642`](https://github.com/horizon-rust/horizon/commit/1d93642094bbe2e46a977586ecaa0ce3da5f516a) Arrows get vanilla's water physics (#127) - [`228bdda`](https://github.com/horizon-rust/horizon/commit/228bdda2011b6232eafb3b58433d8018143390a5) Burning arrows: lava, fire, Flame and what they light (#125, #124) ### 📊 Changes **14 files changed** (+1995 additions, -90 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/examples/arrow_probe.rs` (+266 -0) ➕ `crates/horizon-client/src/arrows.rs` (+1025 -0) 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+190 -9) 📝 `crates/horizon-client/src/game/enchant_effects.rs` (+39 -0) 📝 `crates/horizon-client/src/game/minecarts.rs` (+34 -8) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/illager.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs/undead.rs` (+1 -1) 📝 `crates/horizon-client/src/motion/fluids.rs` (+15 -13) 📝 `crates/horizon-client/src/projectiles.rs` (+40 -57) 📝 `crates/horizon-world/src/entity_fluid.rs` (+1 -1) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaArrowOracle.java` (+158 -0) ➕ `tools/test_arrow_parity.py` (+218 -0) </details> ### 📄 Description Fixes #125 Fixes #124 **Stacked on #187** (arrow port), itself on #186; base is `fix/arrow-water-127`. Retarget before merging the lower PRs with branch deletion. ## Root cause Arrows had no fire state at all: nothing along their path could ignite them (lava, fire, soul fire), the player's Flame bow did nothing (`projectile_spawned` ignite was never applied), and only mobs' Flame bows did anything, as a flat 5-second ignite on hit. With no burning arrows, nothing a burning projectile triggers existed either: TNT priming, lighting campfires/candles/candle cakes, blowing up TNT minecarts. Arrows also passed through minecarts. ## Fix - `arrows.rs` keeps `Entity.remainingFireTicks`. The blocks along the path go through `InsideBlockEffectApplier.StepBasedCollector` in vanilla order: fire and soul fire `fireIgnite` (8 s; +1 from below zero), lava `LAVA_IGNITE` (15 s), water `EXTINGUISH` with its sound. The arrow's fire-immune reset is 0. Fire burns down in flight and not while stuck. - Flame: `EnchantmentHelper.onProjectileSpawned` ignite effects of the held bow (`bow_projectile_ignite`, read from the enchantment JSON). Mobs' `ArrowBonus.flame` also ignites the arrow for 100 s at spawn instead of a special case on hit. - `Projectile.onHitBlock` → `onProjectileHit` for a burning arrow: TNT primes (`tnt_explodes`; `mayInteract` = `mob_griefing` for mobs' arrows), campfires and soul campfires light if dry, candles light if dry, candle cakes light. - A burning arrow sets the entity it hits alight for 5 s. - Arrows hit minecarts (`VehicleEntity.hurt`: damage ×10, breaks past 40). A burning arrow explodes a TNT minecart with `MinecartTNT.explode(projectile.getDeltaMovement().lengthSqr())`. - Burning arrows render `FlameFeatureRenderer`'s fire quads (`block/fire_0`/`fire_1`, scale = width × 1.4, camera-facing about Y, full block light). ## Parity proof `tools/test_arrow_parity.py` (vanilla `Arrow` entities in `VanillaArrowOracle` vs `arrows::tick` in `examples/arrow_probe.rs`) gains the fire corpus: lava pools and lava/water walls (in, through, out, then into water), fire and soul fire curtains, Flame-ignited arrows in flight/stuck/in rain/in water, and burning and cold hits on TNT, campfires (lit, unlit, waterlogged), candles (lit/unlit/waterlogged, 1–4) and candle cakes, checked against the real blocks' `onProjectileHit` (block state written, TNT entity spawned, primed sound and game event). - Mac mini: **105,357 / 105,357** lines on both the client and server jars (rebased on current `main`). - `test_native_scene_motion.py` 2,499,038 / 2,499,038; `cargo clippy --workspace --all-targets -D warnings` clean; `cargo test -p horizon-client --lib` 468 passed. ## In-game check Linux build on a vscreen, survival: - Flame bow → unlit campfire: lit. → unlit candle: lit. → TNT: primed and exploded (the pig behind it hurt, then set alight). - Plain bow through a lava curtain: the arrow comes out burning. Through a fire curtain: burning, and it lights the candle behind it. - Stuck burning arrows keep their flames and fall when the explosion takes their block. - Flame bow → TNT minecart: explodes (strong enough to kill the player 10 blocks away, as the arrow speed feeds the power). ## Left out / notes - `give @s bow[enchantments={flame:1}]` without a namespace doesn't resolve to `minecraft:flame` in Horizon's item component parser (vanilla does); `/enchant` and namespaced ids work. Not part of this change. - Only arrows render the fire quads (other burning entities still don't draw flames). - Pickup (#119) is the next PR in the stack. 🤖 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 15:55:34 +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#2390
No description provided.