-
Notifications
You must be signed in to change notification settings - Fork 549
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
Fixes Explosive pickaxe not properly dropping blocks #4062
base: master
Are you sure you want to change the base?
Conversation
Your Pull Request was automatically labelled as: "✨ Fix" |
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 5 New issues |
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/4062/68b223f5
|
src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java
Outdated
Show resolved
Hide resolved
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.
besides the unused import this LGTM
Quality Gate passedIssues Measures |
// Fixes #4051 | ||
if (sfBlock == null) { | ||
block.breakNaturally(item); |
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.
call Block#breakNaturally will drop drops, it will cause many bugs(double drops,drops that should disappear fall normally)
Description
When using an ExplosiveTool to break vanilla blocks in the vicinity of Slimefun Blocks, drops from the vanilla block would disappear. This adds back those drops.
ASKING FOR OTHER PEOPLE TO TEST ANYWAY BUT BELOW IS WHAT I TESTED
Tested in 1.20 the following towers of blocks (listing bottom to top, breaking the middle one)
Acontainer with items inside, vanilla block, sensitive blocks on both
Acontainer with items inside, vanilla container with items inside, sensitive blocks on both
Acontainer with items inside, shulker with items inside, sensitive blocks on both --> NO DUPES
Acontainer with items inside, vanilla ore, sensitive blocks on both, fortune on the explosive tool --> Multiple drops from the ore
All the above with Acontainer and vanilla swapped to reconfirm nothing broke
As Acontainer I have used an Electric Dust Washer, but they should all work the same.
As vanilla containers I have used chests, furnaces, lecterns, chiseled bookshelves, jukeboxes, all filled.
Proposed changes
When drops are dropped, check if the main block broken was vanilla. If so, drop what it should.
Related Issues (if applicable)
#4051
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values