Skip to content

Show the ingredients taken from storage in crafting plan previews - #234

Open
rubensworks wants to merge 1 commit into
feature/crafting-plan-graphfrom
fix/crafting-plan-preview-storage
Open

rubensworks wants to merge 1 commit into
feature/crafting-plan-graphfrom
fix/crafting-plan-preview-storage

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Based on #233.

Since 3585071 ("Update to new crafting storage in Integrated Crafting"), previews build their plan from CraftingJob#getIngredientsStorageBuffer(). Integrated Crafting only fills that buffer once a job is scheduled, so it is always empty in a preview, and previews never showed any ingredient taken from storage, in any view. For example, a preview of 4 furnace minecarts showed neither the cobblestone for the furnaces nor the raw iron for the ingots.

Previews now use CraftingJob#getIngredientsStorage(), which holds the ingredients the job will take from storage, with its amount already taken into account. The plans of running jobs still use the buffer, as before.

Testing:

  • New game test testCraftingPlanPreviewShowsStorageIngredients: calculates the preview of a chest crafted from logs, and checks that the planks job takes the 2 logs from storage and the chest job takes nothing. It fails without the fix ("Expected Storage ingredients of the planks job to be 1, but was 0").
  • ./gradlew build and all 83 game tests pass.
  • Checked in a dev client, on a world with attuned crafting interfaces, with a preview of 4 furnace minecarts. Before: no stored ingredients. After: 32 cobblestone, 1 iron ingot and 19 raw iron stored, in both the graph and the compact view.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y


Generated by Claude Code

Since the update to the new crafting storage of Integrated Crafting,
previews read the buffer of each crafting job, which is only filled once
the job is started. So previews never showed any ingredients that would
be taken from storage. They now show the ingredients that the job will
take from storage instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants