Fix dead players interacting with specific packets #1312
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking blocks in creative (punching them) usually sends a block break packet with START_DIGGING status, this causes the server to create a
PlayerInteractEvent
withLEFT_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.