Slimefun4
Slimefun4 copied to clipboard
Fix disappearing sensitive blocks on slimefun blocks
Description
Fix disappearing sensitive blocks on slimefun blocks
Proposed changes
BlockListener#dropItems calls e.setDropItems(false) which also cancels drops from sensitive block above.
I added to BlockListener#checkForSensitiveBlockAbove check for non-slimefun sensitive blocks.
I also added some other sensitive materials to sensitive_materials.json.
Related Issues (if applicable)
Resolves #3182
Checklist
- [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
- [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
- [x] I followed the existing code standards and didn't mess up the formatting.
- [ ] I did my best to add documentation to any public classes or methods I added.
- [ ] I have added
NonnullandNullableannotations to my methods to indicate their behaviour for null values - [ ] I added sufficient Unit Tests to cover my code.
Closing this PR for now. We need to find a better solution for this bug.
I do think this would be a good fix even if its a temporarily fix since it now breaks some things in core sf and the addons.
But there is also a bug where blocks that are attached on the side of slimefun block e.g. banner won't drop. This fix will be harder to implement.
Yea fair their will always be edge cases and will always be pain to update. But i think the changes you made should still be applied
Ah, you convinced me
Since you reopened it, it would be nice to support 1.19 blocks aswell.
and maybe we need to think of a way to support wall blocks like banners torches paintings etc, not sure if they even bug if you place them on it. needs testing
There is a cool method in bukkit Block#canPlace but it has been added since 1.18
But there is also a bug where blocks that are attached on the side of slimefun block e.g. banner won't drop. This fix will be harder to implement.
Mmh my message apparently didnt send yesterday. We should probably look in a way to just send physics updates to blocks around it. Not sure if thats have at all since we need all sides of the block being updated.
Edit; from quickly glancing over the code it seems like we dont send physics update. Im also not sure how heavy that is to send to 6 blocks each time a slimefun blocm is broken. It might be good to check that out then we wont even need to update #sentive-materials