-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix cancelled rooted dirt drops being duped #13537
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
base: main
Are you sure you want to change the base?
Conversation
|
Paper devs gotta merge this quick before my Server's Rooted Dirt economy experiences hyperinflation!!1! Simply the best currency imaginable. I know this will immediately get hidden as being spam or off-topic or whatever but I thought it was a funny joke. |
electronicboy
left a comment
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.
This really falls into my qualms about how this logic works in general, it feels messy but it also smells like that is just how this stuff has to work for now
paper-server/patches/sources/net/minecraft/world/item/ItemStack.java.patch
Outdated
Show resolved
Hide resolved
| + } | ||
| + } | ||
| + // Paper start - Fix cancelled rooted dirt drops being duped | ||
| + List<ItemEntity> capturedDrops = null; |
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.
I am a bit confused on the path here.
Why double the variable when the serverLevel.captureDrops exists?
Are we trying to handle the case where this field is non null? In that case, we'd have to store current state and restore later, which we are not doing. If we aren't (which I don't think we need to? captureDrops is for the mineBlock bit, that shouldn't trigger useOn), we don't need such added changes that check for possibly null lists (e.g. if (capturedDrops != null) { below too)
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.
Thanks for the suggestion, I was engaging in a bit of defensive programming there with the extra checks, but I see now it wasn't necessary given the context.
This PR fixes #13536, cancelled rooted dirt drops being duped
Analysis
The rooted dirt item drop logic is being processed in
HoeItem#useOn, the drop capturing isn't enabled in this path, causing hanging roots to still be dropped evenBlockPlaceEventis cancelled.This bug has existed since 1.19, after Mojang added the rooted dirt.