-
-
Notifications
You must be signed in to change notification settings - Fork 381
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 duplicate calls of certain click events #6309
Fix duplicate calls of certain click events #6309
Conversation
#5250 Needs relation investigation. Do you use ViaVersion? |
Nah, this is completely separate from ViaVersion, though I bet it's the same issue. (i also don't use viaversion, to clarify). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work Sovde ⚡
Is it possible to have tests for this? it seems like it can cause issues without a decent testing since we had this implementation for long time
Would need mocking usage, still possible, but over complicated. |
Description
Fixes a bug where right clicking on an entity can fire a right click event twice.
When you right click on an entity with no block in reach, a PlayerInteractEntityEvent is called like normal
However, a PlayerInteractEvent is also called, with the type of RIGHT_CLICK_AIR.
(This is also the case if there's a block in reach, but the SkriptEventHandler filters out non-air clicks with a useItemInHand value of DENY. air clicks ALWAYS have useItemInHand value of DENY for, like, non-usable items. So those aren't an issue). This causes the following:
The solution chosen is to combine the PIEE and PIE trackers, so we can only have one event of either type per tick from a player. This solves the issue, but is a breaking change (on right click on air no longer fires when clicking on an entity). Personally, I think this is acceptable, the behavior is technically a bug. The behavior now becomes the following:
Target Minecraft Versions: any
Requirements: none
Related Issues: #6460