Keep the config extra hooks as interface defaults - #1740
Merged
Merged
Conversation
Making them non-default and implementing them in PartTypeAdapter broke every part type that supplies them through a side interface: a concrete method inherited from a superclass wins over an interface default, so the adapter's empty bodies silently shadowed those implementations, with nothing failing to compile. IntegratedTunnels does exactly that in IPartTypeInterfacePositionedAddon, and its interface channel stopped being copied and pasted by the Wrench. Three of its game tests catch it. These four hooks are optional extension points, so an implementation in the adapter defeats their purpose. They go back to being interface defaults. The other three methods stay non-default: they are core plumbing that nothing supplies that way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V35MFZ7JSgoLe79J4d1uxf
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.
Fixes a regression introduced by #1738, which is merged and published as
1.33.4-2154.That PR resolved the
// TODO: make non-default in nextmajormarkers onIPartTypeby making the methods abstract and moving their bodies intoPartTypeAdapter. For the fourConfigExtrahooks that turned out to be wrong.In Java a concrete method inherited from a superclass takes precedence over an interface default. A part type that supplies these hooks through a side interface therefore stopped working the moment
PartTypeAdaptergained its own empty implementations, and nothing fails to compile — the behaviour just silently disappears.IntegratedTunnels does exactly this:
so its interface channel was no longer copied or pasted by the Wrench. Three of its game tests fail against
1.33.4-2154:The change
snapshotConfigExtra,applyConfigExtra,getConfigExtraRequirementsandgetConfigExtraEntriesgo back to being interface defaults onIPartType, and their implementations are removed fromPartTypeAdapter. These four are optional extension points, so an implementation in the adapter defeats their purpose.The other three methods from #1738 stay non-default:
onAspectVariablesChangedwas already implemented inPartTypeAdapterbefore that PR, andsnapshotConfig/applyConfigare core plumbing that nothing supplies through a side interface.Verified
buildpasses, all 1001 game tests passmavenLocaland re-ran IntegratedTunnels against it: the three interface channel tests pass againI checked the other nine CyclopsMC mods being ported to 26.3 for the same pattern; IntegratedTunnels is the only one that uses it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V35MFZ7JSgoLe79J4d1uxf
Generated by Claude Code