Slimefun / Slimefun4

Slimefun 4 - A unique Spigot/Paper plugin that looks and feels like a modpack. We've been giving you backpacks, jetpacks, reactors and much more since 2013.
GNU General Public License v3.0
968 stars 543 forks source link

Fixes #4087 and some cleanup #4088

Closed WalshyDev closed 9 months ago

WalshyDev commented 9 months ago

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

github-actions[bot] commented 9 months ago

Your Pull Request was automatically labelled as: "✨ Fix" Thank you for contributing to this project! ❤️

WalshyDev commented 9 months ago

cc: @JustAHuman-xD

sonarcloud[bot] commented 9 months ago

Quality Gate Passed Quality Gate passed

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

See analysis details on SonarCloud

github-actions[bot] commented 9 months ago

Slimefun preview build

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!