[PR #4962] [MERGED] Pass flint and steel over a lit candle cake, and snuff through one path #5975

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4962
Author: @MSedgeMC
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/candle-snuff


📝 Commits (2)

  • 9241523 Pass flint and steel over a lit candle cake, and snuff through one path
  • f554e16 Draw the cake snuff smoke where vanilla draws it

📊 Changes

5 files changed (+177 additions, -42 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+40 -11)
📝 crates/horizon-client/src/game/remote.rs (+12 -6)
📝 crates/horizon-world/src/level/interact.rs (+14 -19)
📝 crates/horizon-world/src/level/tests.rs (+110 -5)
📝 tools/port_map/game2-012.tsv (+1 -1)

📄 Description

Three changes to candles, found while checking a gap the ledger says is open (it is not — the empty-hand snuff landed in d21886b2f and b82ebb226, with the client draw in 45e1d44be).

1. Flint and steel on a lit candle cake no longer eats it. CandleCakeBlock.useItemOn passes for flint_and_steel and fire_charge before anything else, so the item lights its fire beside the cake. Horizon had no such arm, so the click fell through to useWithoutItem, which is CakeBlock.eat — a lit candle cake disappeared when a player tried to light a fire next to it. This is the one behaviour here that is wrong on main today.

2. The two hand-snuff branches now call extinguish_candle instead of duplicating AbstractCandleBlock.extinguish inline (19 lines deleted). Behaviour-neutral: the sound, the block-change game event and the drop behaviour are identical, the flag difference (3 vs vanilla's 11) is unread because bit 8 has no reader anywhere in level/, and the block is confirmed to be the lit one before the call.

3. A snuffed candle cake now draws the wick smoke. Vanilla's extinguish adds the smoke for #candle_cakes too; only plain candles emitted the candle_smoke block event, whose client draw already handles cake states.

A test that was red on main is corrected here, and it is worth knowing why nobody saw it. level::tests::a_candle_on_an_uneaten_cake_makes_a_candle_cake ended by using stone on an uneaten cake and asserting the block was untouched. Vanilla eats a slice: CakeBlock.useItemOn answers TRY_WITH_EMPTY_HAND, and ServerPlayerGameMode.useItemOn then calls useWithoutItem on the main hand whatever it holds (265: instanceof TryEmptyHandInteraction, 273: hand == MAIN_HAND, 281: useWithoutItem), which reaches CakeBlock.eat. So cake[bites=1] is right and the assertion was wrong. I ran it on a clean origin/main to be sure before touching someone else's test: it fails there, 8698 vs 8697, exactly as it did in my branch. It has been red since dab1861c2 (PR #4277) and cannot fail in CI, because world!() returns early when .local/horizon-client/26.3 is absent and the runner never has Mojang's data. A level test therefore only runs where prepared resources exist; fixture() failing loudly on CI would have caught this on the day it landed, which is a separate fix worth making.

Proven: on a build box with the prepared data, cargo test -p horizon-world --lib candle → 3 passed and --lib cake → 2 passed, with the corrected expectation. The red baseline was confirmed on clean main before the change.

Not proven: nothing ran in a game — a fire charge beside a lit cake, and the smoke a client draws. There is no parity harness for candle interaction; the flint-and-steel arm is asserted at the use_item_on level only.


🔄 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/4962 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/candle-snuff` --- ### 📝 Commits (2) - [`9241523`](https://github.com/horizon-rust/horizon/commit/92415234d936ef4dfeff26ac1c89c2ce90d70442) Pass flint and steel over a lit candle cake, and snuff through one path - [`f554e16`](https://github.com/horizon-rust/horizon/commit/f554e16b02c2e53552611485c1fdac2a5508dd7c) Draw the cake snuff smoke where vanilla draws it ### 📊 Changes **5 files changed** (+177 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+40 -11) 📝 `crates/horizon-client/src/game/remote.rs` (+12 -6) 📝 `crates/horizon-world/src/level/interact.rs` (+14 -19) 📝 `crates/horizon-world/src/level/tests.rs` (+110 -5) 📝 `tools/port_map/game2-012.tsv` (+1 -1) </details> ### 📄 Description Three changes to candles, found while checking a gap the ledger says is open (it is not — the empty-hand snuff landed in `d21886b2f` and `b82ebb226`, with the client draw in `45e1d44be`). **1. Flint and steel on a lit candle cake no longer eats it.** `CandleCakeBlock.useItemOn` passes for `flint_and_steel` and `fire_charge` *before* anything else, so the item lights its fire beside the cake. Horizon had no such arm, so the click fell through to `useWithoutItem`, which is `CakeBlock.eat` — a lit candle cake disappeared when a player tried to light a fire next to it. This is the one behaviour here that is wrong on `main` today. **2. The two hand-snuff branches now call `extinguish_candle`** instead of duplicating `AbstractCandleBlock.extinguish` inline (19 lines deleted). Behaviour-neutral: the sound, the block-change game event and the drop behaviour are identical, the flag difference (`3` vs vanilla's `11`) is unread because bit 8 has no reader anywhere in `level/`, and the block is confirmed to be the lit one before the call. **3. A snuffed candle cake now draws the wick smoke.** Vanilla's `extinguish` adds the smoke for `#candle_cakes` too; only plain candles emitted the `candle_smoke` block event, whose client draw already handles cake states. **A test that was red on `main` is corrected here, and it is worth knowing why nobody saw it.** `level::tests::a_candle_on_an_uneaten_cake_makes_a_candle_cake` ended by using **stone** on an uneaten cake and asserting the block was untouched. Vanilla eats a slice: `CakeBlock.useItemOn` answers `TRY_WITH_EMPTY_HAND`, and `ServerPlayerGameMode.useItemOn` then calls `useWithoutItem` on the main hand *whatever it holds* (`265: instanceof TryEmptyHandInteraction`, `273: hand == MAIN_HAND`, `281: useWithoutItem`), which reaches `CakeBlock.eat`. So `cake[bites=1]` is right and the assertion was wrong. I ran it on a clean `origin/main` to be sure before touching someone else's test: it fails there, 8698 vs 8697, exactly as it did in my branch. It has been red since `dab1861c2` (PR #4277) and cannot fail in CI, because `world!()` returns early when `.local/horizon-client/26.3` is absent and the runner never has Mojang's data. A level test therefore only runs where prepared resources exist; `fixture()` failing loudly on CI would have caught this on the day it landed, which is a separate fix worth making. **Proven:** on a build box with the prepared data, `cargo test -p horizon-world --lib candle` → 3 passed and `--lib cake` → 2 passed, with the corrected expectation. The red baseline was confirmed on clean `main` before the change. **Not proven:** nothing ran in a game — a fire charge beside a lit cake, and the smoke a client draws. There is no parity harness for candle interaction; the flint-and-steel arm is asserted at the `use_item_on` level only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05: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#5975
No description provided.