Hi! I'm making this pull request to highlight a proposition for a more parity-friendly approach to the reach-around placement feature, alongside a couple of other related changes.
My main idea here is that the old pitch check for calculating whether a block is eligible for reach-around placement should be dropped in favour of a small bit of math to check if a vector drawn from the player's eyes to the end of their reach distance intersects with the block position in front of them. This is functionally more accurate (identical?) to vanilla Bedrock's implementation:
The main canReachAround() method now just returns getRaycastIntersection(player).isPresent().
One drawback of this change which may be a controversial make-or-break, is the now-obsolescence of the config options used to specify the distance and pitch requirements. The distance is handled within the raycasting math itself, so it doesn't make sense to reference it elsewhere. That being said, while writing this, I did attempt to make the raycast length customisable. However, it turned out to be far too confusing to use in my opinion as it didn't modify the functionality proportionate to the player's location on the block. I'm open to other ideas. :)
Some additional changes in this pull request:
Removed the old solid block check and replaced it with an isReplaceable() call. This also helps with parity.
Modified the default values of some reach-around-related config options in order to match vanilla Bedrock Edition.
Hi! I'm making this pull request to highlight a proposition for a more parity-friendly approach to the reach-around placement feature, alongside a couple of other related changes.
My main idea here is that the old pitch check for calculating whether a block is eligible for reach-around placement should be dropped in favour of a small bit of math to check if a vector drawn from the player's eyes to the end of their reach distance intersects with the block position in front of them. This is functionally more accurate (identical?) to vanilla Bedrock's implementation:
The main
canReachAround()
method now just returnsgetRaycastIntersection(player).isPresent()
.One drawback of this change which may be a controversial make-or-break, is the now-obsolescence of the config options used to specify the distance and pitch requirements. The distance is handled within the raycasting math itself, so it doesn't make sense to reference it elsewhere. That being said, while writing this, I did attempt to make the raycast length customisable. However, it turned out to be far too confusing to use in my opinion as it didn't modify the functionality proportionate to the player's location on the block. I'm open to other ideas. :)
Some additional changes in this pull request:
isReplaceable()
call. This also helps with parity.