[26.1] Fix potential desync in BrewingStandBlockEntity.doBrew - #3181
[26.1] Fix potential desync in BrewingStandBlockEntity.doBrew#3181ApexModder wants to merge 1 commit into
BrewingStandBlockEntity.doBrew#3181Conversation
|
|
For transparency, there is still the open question of whether mutation should event be allowed in the post-event. This is just one solution depending on the assumptions made. |
|
If we prefer not to allow mutations via the While this would be a breaking change it would ensure changes via the event happen before |
|
@ApexModder, this pull request has conflicts, please resolve them for this PR to move forward. |
2846c83 to
a2a5d91
Compare
|
I think part of the problem here is that we have two pathways where
If we go by the usual pattern that What I'm thinking we could do here instead is to refactor Mods can then react to vanilla brewing or fully replace it with their own. What is questionable in this is the role that cancellation of the |
This PR fixes a potential desync and oversight in
BrewingStandBlockEntity.doBrew, where thePotionBrewEvent.Postevent allows users to modify the ingredient slot via thesetItemmethod.While the event does modify the backing
NonNullListthedoBrewmethod relies on a localingredientfield which is not correctly updated after the event has fired leading to this desync.This is fixed by simply refreshing the local fields value after the event to pull in any potential mutations that might have occurred.
Note: Initially opening as draft as this PR may need updating after #3179 has been merged to ensure the crafting remainder line is correctly below the patched in field refresher line