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
964 stars 547 forks source link

Fix not dropping sensitive blocks once and for all #4200

Open EpicPlayerA10 opened 4 months ago

EpicPlayerA10 commented 4 months ago

Description

Fixed not dropping sensitive blocks once and for all

Proposed changes

This PR takes a different approach from all other solutions. It listens for BlockPhysicsEvent which fires before block update. Inside listener it checks if block can be placed in the location where event was fired. This is the best method to listen for collapsing sensitive blocks without a headache with SENSITIVE_MATERIALS tag.

The only downside of this solution is that it require at least version 1.18 because it uses BlockData#isSupported method.

Related Issues (if applicable)

Checklist

github-actions[bot] commented 4 months ago

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

github-actions[bot] commented 4 months ago

Slimefun preview build

A Slimefun preview build is available for testing! Commit: fefff5b6

https://preview-builds.walshy.dev/download/Slimefun/4200/fefff5b6

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!