Repository navigation
Stop multiplying the missing ingredients of running jobs by their crafts - #235
Open
rubensworks wants to merge 1 commit into
Open
rubensworks wants to merge 1 commit into
rubensworks wants to merge 1 commit into
Conversation
Integrated Crafting reports the missing ingredients of a running job as the total quantities for all of its remaining crafts, but the crafting plan multiplied them by the remaining crafts again. The missing element in the crafting plan also showed the remaining crafts as its missing quantity, instead of the quantity of the missing ingredient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #233.
Integrated Crafting reports the missing ingredients of a running job (
CraftingJob#getLastMissingIngredients) as the total quantities for all of its remaining crafts. They are computed infillCraftingJobBufferFromStoragefor the job's full amount, and reduced as dependencies deliver outputs. The crafting plan multiplied them by the job's remaining crafts again, in both places that use them:TerminalCraftingPlanStatic#flatten, used by the compact view and the progress of the jobs overview;GuiCraftingPlan#getElements, used by the tree list and graph views. There, the missing element also got the remaining crafts as its missing quantity ("Missing: N" in the tooltip and tree list), instead of the quantity of the missing ingredient.For example, a job that smelts 19 iron ingots with no raw iron left in storage showed 361 missing raw iron (19 × 19). It now shows 19. In #233's original report, 13 missing iron ingots for a job with 3 remaining crafts showed as 39.
Testing:
testCraftingPlanMissingQuantities: plans 2 chests (16 planks), takes 10 planks out of storage before starting the job, and checks that the running plan reports 10 missing planks. It fails without the fix ("Expected Missing planks to be 10, but was 20")../gradlew buildand all 83 game tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Generated by Claude Code