Entity: added getEyePos()

This commit is contained in:
Dylan K. Taylor
2019-08-02 17:29:32 +01:00
parent e03f918806
commit 1cd955c216
5 changed files with 8 additions and 4 deletions

View File

@ -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;
}