Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 PredicateChoice recipe choice for crafting #8446

Closed
luiz-otavio opened this issue Oct 9, 2022 · 4 comments
Closed

Add PredicateChoice recipe choice for crafting #8446

luiz-otavio opened this issue Oct 9, 2022 · 4 comments
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.

Comments

@luiz-otavio
Copy link

luiz-otavio commented Oct 9, 2022

Is your feature request related to a problem?

Yup. I'm having some issues with custom recipes in my plugin, but it seems that ExactChoice doesn't work as a standard implementation for my specific condition to check ingredients, so I tried creating another RecipeChoice but it didn't work since Ingredient#test didn't searches for RecipeChoice#test.

Describe the solution you'd like.

I'd like for a match case for RecipeChoice#test in crafting menu, since it's already a predicate and it would be usable.
Also, we could make PredicateChoice in API to let the developer choose what predicate should work for matching its ingredient.

Describe alternatives you've considered.

I think there isn't another dedicated alternative for that, since the only way to match my custom recipe is based on Ingredient#test, and it should work if it could use RecipeChoice#test

Other

It's an image from the specific code where it would be included in.
image

@luiz-otavio luiz-otavio added status: needs triage type: feature Request for a new Feature. labels Oct 9, 2022
@luiz-otavio
Copy link
Author

If no problem, I can make a pull-request with a dedicated patch for that.

@Xemorr
Copy link
Contributor

Xemorr commented Oct 17, 2022

Have you tried using Events rather than built in recipe types for implementing what you're trying to do. That's how complex custom recipes are typically implemented.

@luiz-otavio
Copy link
Author

Have you tried using Events rather than built in recipe types for implementing what you're trying to do. That's how complex custom recipes are typically implemented.

Yes, sure. I have tried to use another events to implement that, which takes more complicated and complex rather than just making a dedicated RecipeChoice for that.

In my patch (already mentioned above), I introduced a PredicateChoice, which lets the developer choose how should it be able to match the ingredient.

@Machine-Maker Machine-Maker changed the title RecipeChoice#test isn't used to matches Ingredients in crafting menu. Add PredicateChoice recipe choice for crafting Jul 23, 2023
@Machine-Maker Machine-Maker added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Jul 23, 2023
@Machine-Maker
Copy link
Member

I plan to add this in the future after #7822 has been merged, but I want to do it in a way that still works with recipe book clicks which is much more involved than just adding another choice. If that turns out not to be possible, just adding the PredicateChoice and saying it won't work with recipe book clicks will be fine.

@PaperMC PaperMC locked and limited conversation to collaborators Apr 28, 2024
@codebycam codebycam converted this issue into discussion #10553 Apr 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.
Projects
None yet
Development

No branches or pull requests

3 participants