[GH-ISSUE #5099] Recipe book: Space and Enter don't place the last clicked recipe again #1553

Closed
opened 2026-11-02 15:47:55 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @apeirs on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5099

Originally assigned to: @apeirs on GitHub.

🤖 Filed by apeirs's AI agent (Cursor, Claude Opus 5.5), not by apeirs personally.

What happens: in the inventory or at a crafting table, click a recipe in the recipe book (shift-click for a full grid), take the result, then press Space or Enter. Nothing is placed.

Vanilla 26.3: RecipeBookComponent.mouseClicked keeps the recipe a click placed as lastRecipe / lastRecipeCollection (only when tryPlaceRecipe succeeded; slot clicks don't touch it, unlike lastPlacedRecipe). RecipeBookComponent.keyPressed, reached from AbstractRecipeBookScreen.keyPressed before the container's own keys, then handles KeyEvent.isSelection() (Enter, Space, numpad Enter): it plays the button click and calls tryPlaceRecipe(lastRecipeCollection, lastRecipe, event.hasShiftDown()). Key repeats reach it too, so players hold Space (with Shift for full stacks) and shift-click the result to craft a whole inventory quickly. It needs the book visible, the player not a spectator, and the search box not focused (searchBox.capturesInput() takes the key first).

Horizon: recipe_book.rs has no lastRecipe and no key path for the book; Space and Enter on a crafting screen do nothing.

Repro: survival, /recipe give @s minecraft:white_wool_from_string, 12 string. Open the inventory book, shift-click the wool recipe, shift-click the result, /give @s string 12, press Space. Vanilla fills the grid again; Horizon leaves it empty.

I have a fix with a LAN e2e check and will open a PR.

Originally created by @apeirs on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5099 Originally assigned to: @apeirs on GitHub. > 🤖 Filed by apeirs's AI agent (Cursor, Claude Opus 5.5), not by apeirs personally. **What happens:** in the inventory or at a crafting table, click a recipe in the recipe book (shift-click for a full grid), take the result, then press Space or Enter. Nothing is placed. **Vanilla 26.3:** `RecipeBookComponent.mouseClicked` keeps the recipe a click placed as `lastRecipe` / `lastRecipeCollection` (only when `tryPlaceRecipe` succeeded; slot clicks don't touch it, unlike `lastPlacedRecipe`). `RecipeBookComponent.keyPressed`, reached from `AbstractRecipeBookScreen.keyPressed` before the container's own keys, then handles `KeyEvent.isSelection()` (Enter, Space, numpad Enter): it plays the button click and calls `tryPlaceRecipe(lastRecipeCollection, lastRecipe, event.hasShiftDown())`. Key repeats reach it too, so players hold Space (with Shift for full stacks) and shift-click the result to craft a whole inventory quickly. It needs the book visible, the player not a spectator, and the search box not focused (`searchBox.capturesInput()` takes the key first). **Horizon:** `recipe_book.rs` has no `lastRecipe` and no key path for the book; Space and Enter on a crafting screen do nothing. **Repro:** survival, `/recipe give @s minecraft:white_wool_from_string`, 12 string. Open the inventory book, shift-click the wool recipe, shift-click the result, `/give @s string 12`, press Space. Vanilla fills the grid again; Horizon leaves it empty. I have a fix with a LAN e2e check and will open a PR.
Author
Owner

@apeirs commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6542753453 --> @apeirs commented on GitHub (Oct 31, 2026): /claim
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#1553
No description provided.