Skip to content
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

Fix disappearing sensitive blocks on slimefun blocks #3184

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

EpicPlayerA10
Copy link
Contributor

@EpicPlayerA10 EpicPlayerA10 commented Jul 29, 2021

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

  • 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.
  • 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 Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

@EpicPlayerA10 EpicPlayerA10 requested a review from a team as a code owner July 29, 2021 12:56
@TheBusyBiscuit TheBusyBiscuit added the ✨ Fix This Pull Request fixes an issue. label Jul 30, 2021
Sfiguz7
Sfiguz7 previously approved these changes Aug 5, 2021
Copy link
Member

@Sfiguz7 Sfiguz7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted

@Sfiguz7 Sfiguz7 self-assigned this Aug 5, 2021
Copy link
Member

@svr333 svr333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sensitive_materials.json uses tabs instead of spaces, now might be a good time to switch?

svr333
svr333 previously approved these changes Sep 14, 2021
Copy link
Member

@svr333 svr333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@svr333 svr333 requested a review from Sfiguz7 October 10, 2021 22:21
@svr333 svr333 self-assigned this Oct 10, 2021
Sfiguz7
Sfiguz7 previously approved these changes Oct 15, 2021
Copy link
Contributor

@J3fftw1 J3fftw1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are missing amethyst in the list of newly added items.
If this is fixed this will fix a bug in CrystamaeHistoria.

@EpicPlayerA10 EpicPlayerA10 dismissed stale reviews from Sfiguz7 and svr333 via 150746c November 3, 2021 12:42
svr333
svr333 previously approved these changes Nov 4, 2021
@svr333 svr333 requested a review from Sfiguz7 November 22, 2021 14:31
Copy link
Member

@Sfiguz7 Sfiguz7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really sorry about the delay, I think this is missing lanterns. Other than that looks good

Co-authored-by: Sfiguz7 <[email protected]>
Sfiguz7
Sfiguz7 previously approved these changes Dec 20, 2021
Copy link
Member

@Sfiguz7 Sfiguz7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@TheBusyBiscuit TheBusyBiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just blocking this until I get a chance to look over the code.

Honestly, some code documentation could help 😬

@TheBusyBiscuit TheBusyBiscuit self-assigned this Mar 14, 2022
@EpicPlayerA10
Copy link
Contributor Author

Closing this PR for now. We need to find a better solution for this bug.

@J3fftw1
Copy link
Contributor

J3fftw1 commented Oct 12, 2022

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.

@EpicPlayerA10
Copy link
Contributor Author

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.

@J3fftw1
Copy link
Contributor

J3fftw1 commented Oct 12, 2022

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

@EpicPlayerA10
Copy link
Contributor Author

Ah, you convinced me

@EpicPlayerA10 EpicPlayerA10 reopened this Oct 12, 2022
@J3fftw1
Copy link
Contributor

J3fftw1 commented Oct 12, 2022

Since you reopened it, it would be nice to support 1.19 blocks aswell.

@J3fftw1
Copy link
Contributor

J3fftw1 commented Oct 12, 2022

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

@EpicPlayerA10
Copy link
Contributor Author

There is a cool method in bukkit Block#canPlace but it has been added since 1.18

@J3fftw1
Copy link
Contributor

J3fftw1 commented Oct 13, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Fix This Pull Request fixes an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block Placer makes blocks vanish
5 participants