mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Entity: added getEyePos()
This commit is contained in:
@ -1463,7 +1463,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
* @return bool
|
||||
*/
|
||||
public function canInteract(Vector3 $pos, float $maxDistance, float $maxDiff = M_SQRT3 / 2) : bool{
|
||||
$eyePos = $this->getPosition()->add(0, $this->getEyeHeight(), 0);
|
||||
$eyePos = $this->getEyePos();
|
||||
if($eyePos->distanceSquared($pos) > $maxDistance ** 2){
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user