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

Improve the recipe function #218

Merged
merged 7 commits into from
Aug 15, 2024

Conversation

juraj-hrivnak
Copy link
Contributor

  • The recipeFunction now uses SlotMatchResult#getGivenInput instead of SlotMatchResult#getRecipeIngredient to get the inputs.

  • Implemented InputList with .getAt() .findMarked() and findMarkedOrEmpty() methods to get the mark.

  • Changed the inputs parameter of the function to InputList type.

  • IIngredient now implements IMarkable.

  • Renamed both ItemStackMixin#getMark & ItemStackMixin#setMark methods to ItemStackMixin#grs$getMark & ItemStackMixin#grs$setMark. .getMark() & .setMark() are now part of ItemStackMixinExpansion.

- The `recipeFunction` now uses `SlotMatchResult#getGivenInput` instead of `SlotMatchResult#getRecipeIngredient` to get the inputs.

- Implemented `InputList` with `.getAt()` `.findMarked()` and `findMarkedOrEmpty()` methods to get the mark.

- Changed the `inputs` parameter of the function to `InputList` type.

- `IIngredient` now implements `IMarkable`.

- Renamed both `ItemStackMixin#getMark` & `ItemStackMixin#setMark` methods to `ItemStackMixin#grs$getMark` & `ItemStackMixin#grs$setMark`. `.getMark()` & `.setMark()` are now part of `ItemStackMixinExpansion`.
Copy link
Collaborator

@WaitingIdly WaitingIdly left a comment

Choose a reason for hiding this comment

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

vanilla.groovy got moved to a subfolder on the main branch, which is why yours is conflicting

Copy link
Member

@brachy84 brachy84 left a comment

Choose a reason for hiding this comment

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

In this pr you assume that the givenInput can have a mark, which is not true. The given input is the same item from the current crafting grid, which is never marked. The mark only exists on the input ingredients of the recipe and not the actual matched items. So your example shouldnt even work

@brachy84
Copy link
Member

Nevermind what i said

@brachy84 brachy84 merged commit 4347790 into CleanroomMC:master Aug 15, 2024
@brachy84 brachy84 added the enhancement New feature or request label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants