Skip to content

Clean up adjacency condition serialization#4260

Merged
jurrejelle merged 11 commits intoGregTechCEu:1.20.1from
screret:sc/make-adjacency-conditions-sane
Jan 20, 2026
Merged

Clean up adjacency condition serialization#4260
jurrejelle merged 11 commits intoGregTechCEu:1.20.1from
screret:sc/make-adjacency-conditions-sane

Conversation

@screret
Copy link
Copy Markdown
Contributor

@screret screret commented Nov 30, 2025

What

Proper fix for #3816.

Implementation Details

The fluid & block adjacency conditions now once again serialize to a list of holders rather than a string, implemented via a codec that parses the input data lazily (so tags will exists when the condition needs to be parsed).
I also added a generic type to RecipeCondition so the actual type be specified in a better way on methods like createTemplate.

Outcome

no error when joining a server and no odd serialized data format

Potential Compatibility Issues

If anyone has custom condition types (someone probably does?), they'll need to add the generic argument to their class and swap some method return types to the condition's actual type

@screret screret requested a review from a team as a code owner November 30, 2025 22:18
@gustovafing gustovafing added the Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. label Dec 3, 2025
Copy link
Copy Markdown
Contributor

@jurrejelle jurrejelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs docs for the v7.5.0 change on what addon/packdevs have to change in their custom recipe conditions to make it happy with the generics, apart from that lgtm

@jurrejelle jurrejelle added ignore changelog PR should not be added to the changelog. type: refactor Suggestion to refactor a section of code labels Dec 3, 2025
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
@screret screret requested a review from jurrejelle January 6, 2026 20:16
@screret
Copy link
Copy Markdown
Contributor Author

screret commented Jan 6, 2026

well, technically they can just ignore the generics and it will work; it'll just have a few warnings but AFAIK it shouldn't fail to compile.

@jurrejelle
Copy link
Copy Markdown
Contributor

well, technically they can just ignore the generics and it will work; it'll just have a few warnings but AFAIK it shouldn't fail to compile.

ALright, then could you update the Custom Recipe Condition page to at least have the right generics?

@jurrejelle jurrejelle merged commit 3484551 into GregTechCEu:1.20.1 Jan 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 ignore changelog PR should not be added to the changelog. Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants