Skip to content

Fix cross-region block access and replaced block checks - #2321

Merged
me4502 merged 4 commits into
EngineHub:version/7.0.xfrom
byPixelTV:version/7.0.x
Nov 2, 2026
Merged

me4502 merged 4 commits into
EngineHub:version/7.0.xfrom
byPixelTV:version/7.0.x

Conversation

@byPixelTV

Copy link
Copy Markdown
Contributor

Avoid reading a causing block from a region that is not owned by the current Folia thread. This prevents thread violations when a falling block lands in a different region or world from its origin.

Apply the same ownership check to block placement, block breaking, and fire cause checks. When the causing block cannot be read, its material-specific flags cannot be evaluated.

Also fix the replaced-block check in BlockPlaceEvent, which previously compared the replaced material with itself and never fired a break event.

Error log for reference:
https://pastes.dev/UWDTIF5k26

@byPixelTV
byPixelTV requested a review from me4502 November 1, 2026 10:33
@byPixelTV

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I've reverted the unnecessary listener changes and removed the Javadoc. getFirstBlock() now skips blocks outside the current Folia region and continues looking for the next accessible block.

@byPixelTV
byPixelTV requested a review from me4502 November 2, 2026 14:19
@me4502
me4502 merged commit 90acadb into EngineHub:version/7.0.x Nov 2, 2026
2 checks passed
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