Skip to content

Conversation

@Phoenix616
Copy link

@Phoenix616 Phoenix616 commented Dec 11, 2025

This fixes a possible NPE in the CollisionUtil (issue #409, occurred for me on latest Paper 1.21.10 too) which was introduced in 61d329e as the lastBlockAABB != null check was moved after accessing it for the first time. (Previously it was checked before)

I also moved more of the edge detection code away from accessing the array indexes directly to the new variables. As those check if the lastBlockBB was null (and technically these checks themselves only check for 0 or 1 so -1 would behave the same as the lastBlockBB null check) I decided to initialize those values to -1 as it's not possible to leave them unassigned but still use them later. Alternatively one could use a ternary checking for null for each individual variable but I felt that is even uglier code.

@Lysandr0 Lysandr0 merged commit 1449067 into Updated-NoCheatPlus:master Dec 13, 2025
@Lysandr0
Copy link
Member

Thank you so much!
And yeah, that function should get revised later down the road...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants