Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a predicate to the crafting writer #76

Open
Corfiot opened this issue Dec 28, 2021 · 3 comments
Open

Add a predicate to the crafting writer #76

Corfiot opened this issue Dec 28, 2021 · 3 comments

Comments

@Corfiot
Copy link

Corfiot commented Dec 28, 2021

Issue type:

  • ➕ Feature request

Short description:

I want to be able to create a predicate, for example "Do I have less than X items in machine's Y slot Z?" and put that in the crafting writer for the item in question. Then the writer would craft if the result is predicate is true.

Concrete example:
craft enriched redstone items for mekanism's infusing factories, I read the infusion level from the machine via NBT and want to only craft when that is not full.

There are workarounds but I don't like them.

@rubensworks
Copy link
Member

Thanks for the suggestion!

@rubensworks
Copy link
Member

So this would accept an operator that takes no inputs and returns an ingredient/recipe if I understand correctly?

@Corfiot
Copy link
Author

Corfiot commented Dec 29, 2021

A valid question, I guess it could return a recipe but that, IMHO, would be a separate feature, to be implemented after & in addition to this one.

In my original thought it was a predicate returning boolean. True=keep crafting, false=stop crafting. I would expect not to break the pattern in the other components, e.g. the filtering item interface, which auto-populates stuff like Item/uname/name.

The predicate would probably use the writer's recipe as input, from which anything needed to make a decision can be extracted.
In the example I gave, it would take the infusion item created from the output ingredients, count its amount in the machine, then return lessthan(#items_in_network,#desiredamounttohave*const_infusionamountperitemproduced).

Yes it would be complicated but not much more than the items-in-chest-by-mod tutorial.

@rubensworks rubensworks moved this to Options in Features Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Options
Development

No branches or pull requests

2 participants