From aa60aa69ee505b5d12d308c63a0959d66d0b0a90 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 21 Aug 2019 18:51:08 -0400 Subject: [PATCH] World: fix bug in getNearestEntity() fuck you PhpStorm --- src/world/World.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/World.php b/src/world/World.php index b697d3711..91455bf5c 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -1889,7 +1889,7 @@ class World implements ChunkManager{ if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){ continue; } - $distSq = $entity->distanceSquared($pos); + $distSq = $entity->getPosition()->distanceSquared($pos); if($distSq < $currentTargetDistSq){ $currentTargetDistSq = $distSq; $currentTarget = $entity;