Skip to content

Keep jobs of attuned interfaces in the network when their target updates - #251

Merged
rubensworks merged 1 commit into
master-1.20-ltsfrom
fix/attuned-target-neighbour-change-1.20
Oct 14, 2026
Merged

rubensworks merged 1 commit into
master-1.20-ltsfrom
fix/attuned-target-neighbour-change-1.20

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Backport of #250 to 1.20.

Targets such as furnaces notify their neighbours whenever their contents change. PartTypeInterfaceCraftingAttuned.onBlockNeighborChange unregistered the interface from the crafting network on each of these notifications, and only registered it again on the interface's next part update. In between, the interface's crafting jobs were missing from the network's dependency graph. Jobs depending on them were then reported as missing ingredients, and the re-registration duplicated their dependency edges (#249).

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.

Tested with ./gradlew build on JDK 17. The game test from #250 is not included, as this branch has no game tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y


Generated by Claude Code

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

Copy link
Copy Markdown
Member Author

coverage/coveralls is red with a 0.07% coverage drop. The drop is real, and it comes from this PR. The new hasTargetChanged() method has no coverage on this branch: it only runs on neighbour updates of an attuned interface's target, and this branch has no game tests, where that is tested on 1.21 (#250). Covering it here would need a unit test that mocks a part state, a target and a recipe handler. I don't think that's worth its code for an 8-line method that #250 already tests in game. The build, including unit tests, passed.


Generated by Claude Code

@rubensworks
rubensworks merged commit 3c73f89 into master-1.20-lts Oct 14, 2026
3 of 5 checks passed
@rubensworks
rubensworks deleted the fix/attuned-target-neighbour-change-1.20 branch October 14, 2026 18:05
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