mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Player: Fixed interaction checks preventing placing blocks when stood on the corner of one when using crosshairs
This issue can be seen on W10 Edition. Stand on the corner of a block and turn so that the majority of the target block is behind you. Then look down and try to mine it.
This commit is contained in:
parent
2e11e448dd
commit
0688a86f57
@ -1743,11 +1743,11 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
*
|
||||
* @param Vector3 $pos
|
||||
* @param $maxDistance
|
||||
* @param float $maxDiff
|
||||
* @param float $maxDiff default 0.71 (approximately sqrt(2) / 2, half of the diagonal width of a block)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canInteract(Vector3 $pos, $maxDistance, float $maxDiff = 0.5) : bool{
|
||||
public function canInteract(Vector3 $pos, $maxDistance, float $maxDiff = 0.71) : bool{
|
||||
$eyePos = $this->getPosition()->add(0, $this->getEyeHeight(), 0);
|
||||
if($eyePos->distanceSquared($pos) > $maxDistance ** 2){
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user