[PR #6560] [MERGED] A furnace fuel leaves its crafting remainder, not only a bucket #6951

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6560
Author: @Akirabane
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat/6524-furnace-fuel-remainder


📝 Commits (2)

  • 9296774 A furnace fuel leaves its crafting remainder, not only a bucket
  • f30f3d8 Merge origin/main into feat/6524-furnace-fuel-remainder

📊 Changes

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

View changed files

📝 crates/horizon-client/src/furnace.rs (+121 -18)
📝 crates/horizon-client/src/game/block_entity_ticks.rs (+8 -2)
📝 crates/horizon-client/src/game/campfire.rs (+1 -1)
📝 docs/mods.md (+2 -2)

📄 Description

🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review.

Fixes #6524

What was wrong

AbstractFurnaceBlockEntity.consumeFuel (read with javap on the 26.3 server jar) takes the fuel item's own crafting remainder, shrinks the fuel stack by one, then puts the remainder in the fuel slot if the stack is empty, or drops it at the furnace (Containers.dropItemStack) if more of the fuel is left. furnace.rs only knew the lava, water and milk buckets by name, so a content mod's fuel with a crafting_remainder (PR #4925) burnt without leaving it (docs/mods.md said "not yet as furnace fuel").

What changed

  • furnace.rs: the remainder is the item's crafting_remainder from the items table, the field the crafting grid already reads. The three buckets keep working: they carry theirs in CRAFT_REMAINDERS. The hard-coded remainder match is gone.
  • FurnaceCooking::tick takes a drops list for what the furnace lets fall; its one caller (tick_furnace) drops each with the same helper the campfire uses for Containers.dropItemStack(level, x, y, z, stack) (campfire_drop, now pub(super)).
  • docs/mods.md: the remainder holds as furnace fuel too; a brewing stand still has none.

How it was checked

Unit tests in furnace.rs over a temp data root with one smelting recipe and an items table with a plain fuel and a content mod's fuel that leaves test:husk:

  • the last fuel of a stack leaves its remainder in the fuel slot;
  • a stack of three burns one, keeps two and drops the remainder;
  • a plain fuel leaves nothing, with a stack of one or two.

In the game (horizon-ctl launch --offscreen, creative world): two furnaces set with /setblock holding raw iron and, one a lava bucket, the other two coal. After a few ticks /data get block shows the lava bucket furnace burning (lit_time_remaining 19910) with a minecraft:bucket in the fuel slot, and the coal furnace with one coal left and nothing else, as before the change.

Self-check

tools/pr_ready.py --quick --base origin/main (rustfmt fixed afterwards, then main merged and the furnace tests rerun):

Check Result
Scope 4 files, +134 −23
Cargo.lock unchanged
rustfmt ✅ (after cargo fmt)
clippy ✅
tests: horizon-client, horizon-client-lib 586 passed, 2 failed: native_hooks::native_breathing_stays_hookable and native_loot_kinds_stay_hookable read a source file with LF line endings; they fail the same way on my Windows checkout without this change
Python tests 1 error: test_port_ledger (a global tests package shadows the repo's on my machine), not touched here
Parity not run (--quick): the CI parity job picks the affected harnesses

Label: a fix for content mods, no feature label.


🔄 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/6560 **Author:** [@Akirabane](https://github.com/Akirabane) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/6524-furnace-fuel-remainder` --- ### 📝 Commits (2) - [`9296774`](https://github.com/horizon-rust/horizon/commit/92967740a6dcba5f4330837b82ef6438a72bb80d) A furnace fuel leaves its crafting remainder, not only a bucket - [`f30f3d8`](https://github.com/horizon-rust/horizon/commit/f30f3d84026206399955f55309be2d53094d2310) Merge origin/main into feat/6524-furnace-fuel-remainder ### 📊 Changes **4 files changed** (+132 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/furnace.rs` (+121 -18) 📝 `crates/horizon-client/src/game/block_entity_ticks.rs` (+8 -2) 📝 `crates/horizon-client/src/game/campfire.rs` (+1 -1) 📝 `docs/mods.md` (+2 -2) </details> ### 📄 Description > 🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review. Fixes #6524 ## What was wrong `AbstractFurnaceBlockEntity.consumeFuel` (read with `javap` on the 26.3 server jar) takes the fuel item's own crafting remainder, shrinks the fuel stack by one, then puts the remainder in the fuel slot if the stack is empty, or drops it at the furnace (`Containers.dropItemStack`) if more of the fuel is left. `furnace.rs` only knew the lava, water and milk buckets by name, so a content mod's fuel with a `crafting_remainder` (PR #4925) burnt without leaving it (`docs/mods.md` said "not yet as furnace fuel"). ## What changed - `furnace.rs`: the remainder is the item's `crafting_remainder` from the items table, the field the crafting grid already reads. The three buckets keep working: they carry theirs in `CRAFT_REMAINDERS`. The hard-coded `remainder` match is gone. - `FurnaceCooking::tick` takes a `drops` list for what the furnace lets fall; its one caller (`tick_furnace`) drops each with the same helper the campfire uses for `Containers.dropItemStack(level, x, y, z, stack)` (`campfire_drop`, now `pub(super)`). - `docs/mods.md`: the remainder holds as furnace fuel too; a brewing stand still has none. ## How it was checked Unit tests in `furnace.rs` over a temp data root with one smelting recipe and an items table with a plain fuel and a content mod's fuel that leaves `test:husk`: - the last fuel of a stack leaves its remainder in the fuel slot; - a stack of three burns one, keeps two and drops the remainder; - a plain fuel leaves nothing, with a stack of one or two. In the game (`horizon-ctl launch --offscreen`, creative world): two furnaces set with `/setblock` holding raw iron and, one a lava bucket, the other two coal. After a few ticks `/data get block` shows the lava bucket furnace burning (`lit_time_remaining` 19910) with a `minecraft:bucket` in the fuel slot, and the coal furnace with one coal left and nothing else, as before the change. ## Self-check `tools/pr_ready.py --quick --base origin/main` (rustfmt fixed afterwards, then main merged and the furnace tests rerun): | Check | Result | | --- | --- | | Scope | 4 files, +134 −23 | | Cargo.lock | unchanged | | rustfmt | ✅ (after `cargo fmt`) | | clippy | ✅ | | tests: horizon-client, horizon-client-lib | 586 passed, 2 failed: `native_hooks::native_breathing_stays_hookable` and `native_loot_kinds_stay_hookable` read a source file with LF line endings; they fail the same way on my Windows checkout without this change | | Python tests | 1 error: `test_port_ledger` (a global `tests` package shadows the repo's on my machine), not touched here | | Parity | not run (`--quick`): the CI parity job picks the affected harnesses | Label: a fix for content mods, no `feature` label. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:04 +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#6951
No description provided.