Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Allow LEFT_CLICK_AIR in 3.0->4.5 range of entity

Open Moulberry opened this issue 1 year ago • 3 comments

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

Moulberry avatar May 14 '23 13:05 Moulberry

Tested on build-pr-jar, and works as intended.

3meraldK avatar May 20 '23 21:05 3meraldK

Last commit changes Adventure mode bypass to specifically check if the hit type is block. The old patch was broken in this regard.

Moulberry avatar May 20 '23 21:05 Moulberry

Can you @Owen1212055 review this pull?

3meraldK avatar Jun 11 '23 12:06 3meraldK

PR has been rebased

Moulberry avatar Jun 13 '23 09:06 Moulberry

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.

Moulberry avatar Jun 19 '23 14:06 Moulberry