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

[1.20.4] Stack aware getFoodComponent #3520

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

modmuss50
Copy link
Member

@modmuss50 modmuss50 commented Jan 12, 2024

99% of the work was done in #3295 by @Phoupraw just a 1.20.4 version

This is the same, just targgeting 1.20.4 and using @WrapOperation in place of @reDIrect

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>
@modmuss50 modmuss50 added the enhancement New feature or request label Jan 12, 2024
@modmuss50 modmuss50 changed the title Stack aware getFoodComponent [1.20.4] Stack aware getFoodComponent Jan 12, 2024
@modmuss50 modmuss50 requested a review from a team January 12, 2024 10:41
@modmuss50 modmuss50 added the last call If you care, make yourself heard right away! label Jan 12, 2024
@LlamaLad7
Copy link

I wouldn’t use WrapOperation for any of those. They are all meaningful unconditional replacements and as such they should always be the innermost thing in a wrapper chain, and if another mod wants to do a meaningful unconditional replacement as well then they should conflict. For those reasons Redirect is the right choice. The ThreadLocal should however be replaced with a @Share.

@modmuss50
Copy link
Member Author

I wouldn’t use WrapOperation for any of those. They are all meaningful unconditional replacements and as such they should always be the innermost thing in a wrapper chain, and if another mod wants to do a meaningful unconditional replacement as well then they should conflict. For those reasons Redirect is the right choice. The ThreadLocal should however be replaced with a @Share.

Reverted that change and moved to share. Thats a good point, I didnt really give it much thought 👍

Copy link

@LlamaLad7 LlamaLad7 left a comment

Choose a reason for hiding this comment

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

LGTM. There are situations in which you would want to wrap even without calling the original, but as with everything in mixin it’s nuanced.

@modmuss50 modmuss50 added the merge me please Pull requests that are ready to merge label Jan 14, 2024
@modmuss50 modmuss50 merged commit d6f2b08 into FabricMC:1.20.4 Jan 15, 2024
modmuss50 added a commit that referenced this pull request Jan 15, 2024
* Stack aware `getFoodComponent`

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>

* Back to redirects

---------

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>
(cherry picked from commit d6f2b08)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request last call If you care, make yourself heard right away! merge me please Pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants