Repository navigation
Keep jobs of attuned interfaces in the network when their target updates - #250
Merged
Merged
Conversation
Targets such as furnaces notify their neighbours every time their contents change. Attuned crafting interfaces unregistered from the crafting network on each of these notifications, and only registered again on their next update. In between, their crafting jobs were missing from the dependency graph, so dependent jobs were reported as missing ingredients. Attuned interfaces now only re-register when their target gained or lost its recipe handler, or exposes other recipes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Member
Author
|
The drop doesn't come from code this PR removes. The only new main code is Generated by Claude Code |
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.
Targets such as furnaces notify their neighbours whenever their contents change, so on every inserted input and every extracted output.
PartTypeInterfaceCraftingAttuned.onBlockNeighborChangereacted to each of these by unregistering the interface from the crafting network (removeTargetFromNetwork). It only registered again on the interface's next part update (addTargetToNetworkonly setsshouldAddToCraftingNetwork).In between, which was 20 to 40 ticks in a test world, the interface's crafting jobs were missing from the network's dependency graph:
PENDING_INGREDIENTSwith their stale missing ingredients. In Integrated Terminals, this shows the plan of a running job briefly failing with missing ingredients after every smelted item.Attuned interfaces now only re-register when their target gained or lost its recipe handler, or exposes other recipes than the ones that were last read.
Testing:
testAttunedTargetUpdatesKeepJobDependencies: attuned interfaces on a crafting table and a furnace craft a stone button from cobblestone. Every tick while the furnace is smelting, it checks that the smelting job stays in the dependency graph and that the button job keeps waiting for it. It fails without the fix ("The smelting job left the dependency graph")../gradlew buildand all 81 game tests pass.PENDING_INGREDIENTS. After: in the same world and job, this never happened over 12 ingots, and the job completed.🤖 Generated with Claude Code
https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
Generated by Claude Code