-
-
Notifications
You must be signed in to change notification settings - Fork 198
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 CraftingContext support #1181
base: 1.21.x
Are you sure you want to change the base?
Conversation
|
Previously we only supported the player in the get remaining items stage, this adds it to all stages of recipe evaluation and adds the Level and CraftingContainer as well.
2f6e41b
to
d9bc53c
Compare
if (this.player instanceof ServerPlayer serverplayer) { | ||
Level level = serverplayer.level(); | ||
CraftingInput craftinginput = this.container.asCraftInput(); | ||
+ // using the player-free context here since the player won't be usable by the dispense method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment right? I see a serverplayer variable still being passed in. Looks the same as CraftingMenu patch
Would it be better to create either
If there is preference to keep the static threadlocal, for whatever reason, it should be moved to a field on |
@Random832, this pull request has conflicts, please resolve them for this PR to move forward. |
Is this PR still active/desired or should it be closed? There's some comments still outstanding and merge conflicts that needs resolving |
Previously we only supported the player in the get remaining items stage, this adds it to all stages of recipe evaluation and adds the Level and CraftingContainer as well. This will help in situations such as: the recipe needs to use durability from items in get remaining items; the recipe needs to distinguish between two identical inputs where one is shifted down or right in the grid; etc.