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

Do not check interactions outside plot areas #4515

Merged
merged 1 commit into from
Oct 13, 2024
Merged

Do not check interactions outside plot areas #4515

merged 1 commit into from
Oct 13, 2024

Conversation

SirYwell
Copy link
Member

@SirYwell SirYwell commented Oct 9, 2024

Overview

Fixes #4513

Description

I don't exactly know how to reproduce the exception, but it makes sense to be more defensive here, avoiding NPEs in situations the target location is not in a plot area.

Submitter Checklist

@SirYwell SirYwell requested a review from a team as a code owner October 9, 2024 16:38
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Oct 9, 2024
@PierreSchwang
Copy link
Member

I do kind of suspect the issue being that we use getPlotAreaAbs in the listener, whereas in the class where the area is null we use getPlotArea - but I can't really look into how they function differently rn

@SirYwell
Copy link
Member Author

SirYwell commented Oct 9, 2024

I think the former is just on PlotPlayer rather than Location, but does the same actually.

Copy link
Member

@PierreSchwang PierreSchwang left a comment

Choose a reason for hiding this comment

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

Oh yeah, I see - in the listener the are of the player is checked (where the player is actually standing) whereas the location param of checkPlayerBlockEvent is the location of the block triggering the event. So those are most certainly always different - which is no issue in classical plot worlds ig

but the fix should make sense i guess

@NotMyFault NotMyFault merged commit 641e384 into main Oct 13, 2024
8 checks passed
@NotMyFault NotMyFault deleted the fix/4513 branch October 13, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console Error
3 participants