Skip to content

Fix custom ingredient implementation #4276

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

Merged

Conversation

PepperCode1
Copy link
Member

  • Override isEmpty in CustomIngredientImpl
  • Override acceptsItem in CustomIngredientImpl
  • Override equals and hashCode in CustomIngredientImpl so CustomIngredients can also implement them
    • Adjust the class doc of CustomIngredient to encourage implementors to do so
  • Implement Ingredient#hashCode
  • Remove incorrect Nullable annotation from ItemStack parameter in CustomIngredientImpl#test
  • Simplify default implementation of CustomIngredient#toDisplay as created RegistryEntryList would always contain right storage
  • Implement equals and hashCode on all builtin custom ingredient classes

Fixes #4270.

- Override isEmpty in CustomIngredientImpl
- Override acceptsItem in CustomIngredientImpl
- Override equals and hashCode in CustomIngredientImpl so CustomIngredients can also implement them
  - Adjust the class doc of CustomIngredient to encourage implementors to do so
- Implement Ingredient#hashCode
- Remove incorrect Nullable annotation from ItemStack parameter in CustomIngredientImpl#test
- Implement equals and hashCode on all builtin custom ingredient classes
@PepperCode1 PepperCode1 added bug Something isn't working priority: high High priority PRs that need review and work now. Review these first. enhancement New feature or request labels Dec 5, 2024
Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

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

Looks good at a very quick glance.

@modmuss50 modmuss50 added the status: merge me please Pull requests that are ready to merge label Dec 5, 2024
@modmuss50 modmuss50 merged commit fa62a02 into FabricMC:1.21.4 Dec 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request priority: high High priority PRs that need review and work now. Review these first. status: merge me please Pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomIngredient broken equality
4 participants