Paper
Paper copied to clipboard
Allow LEFT_CLICK_AIR in 3.0->4.5 range of entity
In Creative, the block and entity reach is the same (4.5), so the code works as is. In Adventure, the event always fires, so the code works as is. In Survival, the block reach is 4.5 and the entity reach is 3.0. Therefore, the existing code will not fire a LEFT_CLICK_AIR if an entity is between 3.0 and 4.5 blocks away.
To be honest, this entire method of performing a raycast to decide whether or not to fire a LEFT_CLICK_AIR is rather error-prone, even with this fix. As of 1.19.4, the vanilla client will send the block/entity interaction packets before the swing, so using that information to decide whether or not to fire LEFT_CLICK_AIR would (in my opinion) be more reliable.
Download the paperclip jar for this pull request: paper-9211.zip
Tested on build-pr-jar, and works as intended.
Last commit changes Adventure mode bypass to specifically check if the hit type is block. The old patch was broken in this regard.
Can you @Owen1212055 review this pull?
PR has been rebased
A week went by and now there are more conflicts. I'm not going to continually rebase this PR. Whenever a maintainer is ready to merge, it can be dealt with.