Skip to content

Coalesce Base Predicate counts + information into record and make MultiPredicate have counts - #5342

Draft
ghzdude wants to merge 8 commits into
GregTechCEu:1.20.1from
ghzdude:gh/predicate-settings
Draft

Coalesce Base Predicate counts + information into record and make MultiPredicate have counts#5342
ghzdude wants to merge 8 commits into
GregTechCEu:1.20.1from
ghzdude:gh/predicate-settings

Conversation

@ghzdude

@ghzdude ghzdude commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What

Multipredicates should now be able to be treated like base predicates for testing min/max counts

Implementation Details

Added record PredicateSettings which combines several of BasePredicate's fields
MultiPredicate also has a settings field, though it is nullable unlike in BasePredicate
For MultiPredicates, if settings == null they behave exactly as before.
When settings is nonnull, it also gets checked along with children predicates
both must be true to pass
Lang has also been introduced for the to-be-used recipe view tooltips

AI Usage

  • No AI driven tools were used for this pull request.
  • Yes AI driven tools were used for this pull request.

Outcome

you should be able to do a.or(b).setMinCount(4) to mean "4 combined of either predicates" now

How Was This Tested

ran client, only check the assembly line which formed as expected

PredicateSettings codec (unused)
update xorpred nonvalid
global/slice count key to PredicateSettings
add set settings
copy settings
@ghzdude ghzdude added type: refactor Suggestion to refactor a section of code 1.20.1 labels Aug 24, 2026
}

@CheckReturnValue
public MultiPredicate setMinCount(int min) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we add a bool if the min and max counts should be applied to children?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants