[PR #644] [MERGED] Open furnaces, blast furnaces and smokers on a server #2692

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

📋 Pull Request Information

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

Base: main ← Head: fix/furnace-on-server


📝 Commits (4)

  • 66d187e Respawn on a server in vanilla's order, so vanilla clients leave the loading screen
  • 4097058 Wrap mixed translation arguments once, so vanilla clients can read /give
  • e7f7236 Open furnaces, blast furnaces and smokers on a server
  • 1a68d8d Merge main into fix/furnace-on-server

📊 Changes

9 files changed (+469 additions, -50 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+37 -5)
📝 crates/horizon-client/src/game/lan_crafting.rs (+73 -1)
📝 crates/horizon-client/src/lan/containers.rs (+45 -1)
📝 crates/horizon-client/src/lan/data.rs (+30 -16)
📝 crates/horizon-client/src/lan/guest.rs (+3 -0)
📝 crates/horizon-client/src/lan/hub.rs (+76 -16)
📝 crates/horizon-client/src/lan/menu.rs (+2 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+162 -7)
📝 tools/test_dedicated_server_parity.py (+41 -4)

📄 Description

Fixes #540

Stacked on #624 (respawn): this branch contains #624's commit, because its harness scenario continues after the respawn. Merge #624 first; this PR's own changes are the last two commits.

What was wrong

  • Furnaces: right-clicking a furnace, blast furnace or smoker as a guest of a Horizon server did nothing. lan_open_container only handed chests, barrels, hoppers, dispensers, droppers and shulker boxes to guests.
  • /give disconnected vanilla clients: while testing this I found that a vanilla client on a Horizon server was disconnected by its own /give reply. component_nbt wrapped the numbers in a mixed list under the empty key, and the NBT writer then wrapped those wrappers again, as ListTag.wrapIfNeeded does. The client unwrapped once and read a {"": 1} argument.

What changed

  • /give reply (commit "Wrap mixed translation arguments once…", lan/data.rs): component_nbt now leaves the wrapping to the writer. New test mixed_translation_arguments_are_wrapped_once checks it.
  • Opening (game/lan_actions.rs): a furnace block entity opens minecraft:furnace, minecraft:blast_furnace or minecraft:smoker, titled container.furnace, container.blast_furnace or container.smoker, over the block entity's 3 slots.
  • Clicks (game/lan_crafting.rs, lan_furnace_click) run the host's own AbstractFurnaceMenu:
    • the fuel slot and the take-only result slot;
    • shift-clicks route by recipe and by fuel;
    • drags span clicks.
    • The slots are written back to the block entity. A new input restarts cooking (AbstractFurnaceBlockEntity.setItem).
    • The client is corrected as for any other guest click.
  • Progress (lan/containers.rs): as broadcastChanges does, after the slot changes the host sends ContainerSetData for the lit time left, the lit total, the cooking timer and the cooking total whenever they change, so the flame and arrow move.
  • Harness (tools/test_dedicated_server_parity.py, VanillaProtocolClient.java). After respawning, the vanilla client:
    • sets a furnace beside itself and gives itself raw iron and coal;
    • opens the furnace and shift-clicks the ore in, the coal in and, 12 s later, the ingot out.
    • It records the menu type and title, the contents, every slot each click changes, and the lit and cooking totals.
    • A client error now lists its causes.
    • Two console lines vanilla has and Horizon doesn't yet are filtered with the existing not-yet lines: the op's command feedback ([Tester: Gave …]) and the guest's advancement announcement.

Verification

  • dedicated server: 584 transcript lines identical against vanilla. The furnace lines are identical, from the open to the ingot landing in hotbar slot 8.
  • Workspace cargo clippy --all-targets -D warnings and cargo fmt --check are clean.
  • cargo test -p horizon-client --lib --bins passes.
  • tools/parity.py --changed origin/main runs on the integration commit; the results will be posted here.

Not covered

  • Taking the result does not drop experience orbs (awardUsedRecipesAndPopExperience). Horizon doesn't track a furnace's used recipes in single player either (RecipesUsed is saved empty).

🤖 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/644 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/furnace-on-server` --- ### 📝 Commits (4) - [`66d187e`](https://github.com/horizon-rust/horizon/commit/66d187ed06e904a2937ef6da51189f8193fc6d37) Respawn on a server in vanilla's order, so vanilla clients leave the loading screen - [`4097058`](https://github.com/horizon-rust/horizon/commit/40970589bef33063caff17618b2325646f978ba0) Wrap mixed translation arguments once, so vanilla clients can read /give - [`e7f7236`](https://github.com/horizon-rust/horizon/commit/e7f7236c342f1bb3e160308f154590bf125f0495) Open furnaces, blast furnaces and smokers on a server - [`1a68d8d`](https://github.com/horizon-rust/horizon/commit/1a68d8ddf0140a7496932e8629060b2e60c573ea) Merge main into fix/furnace-on-server ### 📊 Changes **9 files changed** (+469 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+37 -5) 📝 `crates/horizon-client/src/game/lan_crafting.rs` (+73 -1) 📝 `crates/horizon-client/src/lan/containers.rs` (+45 -1) 📝 `crates/horizon-client/src/lan/data.rs` (+30 -16) 📝 `crates/horizon-client/src/lan/guest.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+76 -16) 📝 `crates/horizon-client/src/lan/menu.rs` (+2 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+162 -7) 📝 `tools/test_dedicated_server_parity.py` (+41 -4) </details> ### 📄 Description Fixes #540 **Stacked on #624** (respawn): this branch contains #624's commit, because its harness scenario continues after the respawn. Merge #624 first; this PR's own changes are the last two commits. ## What was wrong - **Furnaces:** right-clicking a furnace, blast furnace or smoker as a guest of a Horizon server did nothing. `lan_open_container` only handed chests, barrels, hoppers, dispensers, droppers and shulker boxes to guests. - **`/give` disconnected vanilla clients:** while testing this I found that a vanilla client on a Horizon server was disconnected by its own `/give` reply. `component_nbt` wrapped the numbers in a mixed list under the empty key, and the NBT writer then wrapped those wrappers again, as `ListTag.wrapIfNeeded` does. The client unwrapped once and read a `{"": 1}` argument. ## What changed - **`/give` reply** (commit "Wrap mixed translation arguments once…", `lan/data.rs`): `component_nbt` now leaves the wrapping to the writer. New test `mixed_translation_arguments_are_wrapped_once` checks it. - **Opening** (`game/lan_actions.rs`): a furnace block entity opens `minecraft:furnace`, `minecraft:blast_furnace` or `minecraft:smoker`, titled `container.furnace`, `container.blast_furnace` or `container.smoker`, over the block entity's 3 slots. - **Clicks** (`game/lan_crafting.rs`, `lan_furnace_click`) run the host's own `AbstractFurnaceMenu`: - the fuel slot and the take-only result slot; - shift-clicks route by recipe and by fuel; - drags span clicks. - The slots are written back to the block entity. A new input restarts cooking (`AbstractFurnaceBlockEntity.setItem`). - The client is corrected as for any other guest click. - **Progress** (`lan/containers.rs`): as `broadcastChanges` does, after the slot changes the host sends `ContainerSetData` for the lit time left, the lit total, the cooking timer and the cooking total whenever they change, so the flame and arrow move. - **Harness** (`tools/test_dedicated_server_parity.py`, `VanillaProtocolClient.java`). After respawning, the vanilla client: - sets a furnace beside itself and gives itself raw iron and coal; - opens the furnace and shift-clicks the ore in, the coal in and, 12 s later, the ingot out. - It records the menu type and title, the contents, every slot each click changes, and the lit and cooking totals. - A client error now lists its causes. - Two console lines vanilla has and Horizon doesn't yet are filtered with the existing not-yet lines: the op's command feedback (`[Tester: Gave …]`) and the guest's advancement announcement. ## Verification - `dedicated server: 584 transcript lines identical` against vanilla. The furnace lines are identical, from the open to the ingot landing in hotbar slot 8. - Workspace `cargo clippy --all-targets -D warnings` and `cargo fmt --check` are clean. - `cargo test -p horizon-client --lib --bins` passes. - `tools/parity.py --changed origin/main` runs on the integration commit; the results will be posted here. ## Not covered - Taking the result does not drop experience orbs (`awardUsedRecipesAndPopExperience`). Horizon doesn't track a furnace's used recipes in single player either (`RecipesUsed` is saved empty). 🤖 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:58:18 +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#2692
No description provided.