Closed WalshyDev closed 9 months ago
Your Pull Request was automatically labelled as: "✨ Fix" Thank you for contributing to this project! ❤️
cc: @JustAHuman-xD
The SonarCloud Quality Gate passed, but some issues were introduced.
15 New issues
0 Security Hotspots
66.7% Coverage on New Code
0.0% Duplication on New Code
A Slimefun preview build is available for testing! Commit: 1839ddca
https://preview-builds.walshy.dev/download/Slimefun/4088/1839ddca
Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!
Description
Per #4087 if you can get into the inventory of a broken block you can easily dupe items (take them out of the inv before cleanup - 500ms by default and from block drops). We want to fix that and there's also just some general cleanup
Proposed changes
There are 2 parts to this fix, the first is disabling opening the inventory if the block is broken. The second is closing the inventory on block create (rather than an SF tick later). Created a pretty long test to validate this behaviour and fully verified it through debugger.
I also did a bit of cleanup, and commented out
checkForSensitiveBlocks
rather than the code in the function so we don't have random unused code. Moved @Nonnull annotations in BiomeMap as vscode was freaking out over it being in the middle of generics.Related Issues (if applicable)
Fixes #4087
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values