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

Fix milk bucket curing effects before advancement trigger #170

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Fix milk bucket curing effects before advancement trigger #170

merged 1 commit into from
Nov 10, 2023

Conversation

Su5eD
Copy link
Contributor

@Su5eD Su5eD commented Oct 8, 2023

The issue

Forge moves the effect curing call in MilkBucketItem#finishUsingItem to the method's head, in order to use the stack's properties before it is emptied. However, the method call also comes before the item use advancement trigger, which prevents it from being used in combination with advancement criterions that check for the user's active effects.

Here's the advancement I used to test this behavior. It is supposed to trigger when the player consumes milk with the nausea effect active.

The solution

We move the method call to curePotionEffects after the advancement trigger so that it meets both of our criteria - allowing the advancement to run and still being able to access the stack in the effect curing method.

Fixes #151

@sciwhiz12 sciwhiz12 added bug A bug or error 1.20 Targeted at Minecraft 1.20 triage Needs triaging and confirmation labels Oct 9, 2023
@Technici4n
Copy link
Member

This one needs updating to 20.2 too 😄

@Su5eD
Copy link
Contributor Author

Su5eD commented Nov 9, 2023

Updated to 1.20.2 and re-tested

@Technici4n Technici4n merged commit ef633ca into neoforged:1.20.x Nov 10, 2023
2 checks passed
@Su5eD Su5eD deleted the fix/milk-bucket branch November 10, 2023 10:12
Gaming32 added a commit to Gaming32/bingo that referenced this pull request Nov 10, 2023
Xing-C added a commit to Xing-C/NeoForge that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 Targeted at Minecraft 1.20 bug A bug or error triage Needs triaging and confirmation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Milk bucket curing is invoked before advancements
3 participants