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 dead players interacting with specific packets #1312

Merged
merged 1 commit into from
May 3, 2024

Conversation

Pablete1234
Copy link
Member

Breaking blocks in creative (punching them) usually sends a block break packet with START_DIGGING status, this causes the server to create a PlayerInteractEvent with LEFT_CLICK_BLOCK, which PGM cancels for non-interacting players. All is fine.

However, sending a block break packet with STOP BREAKING status, has completely different logic on the bukkit-side, and will only do a check for if it's valid (you sent a start digging early enough) and then proceed to create a BlockBreakEvent. PGM will turn this event into a BlockTransformEvent, which should get cancelled, but due to a change in logic a long time ago, is now only cancelled if the party is non-interacting (ie: you're in obs, or match isn't running), which excludes dead (and frozen) players, allowing for this exploit to happen.

@Pablete1234 Pablete1234 added bug Something isn't working urgent Breaks the plugin ready PR is ready to merge labels May 3, 2024
@Pablete1234 Pablete1234 requested a review from Electroid as a code owner May 3, 2024 15:07
@Pablete1234 Pablete1234 force-pushed the fix-dead-block-break branch from 830c38f to 8c72fe1 Compare May 3, 2024 15:14
@Electroid Electroid merged commit 4366da2 into dev May 3, 2024
2 checks passed
@Electroid Electroid deleted the fix-dead-block-break branch May 3, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PR is ready to merge urgent Breaks the plugin
Development

Successfully merging this pull request may close these issues.

2 participants