This commit is contained in:
Dylan K. Taylor 2019-08-23 17:16:37 +01:00
commit b2cd13daac

View File

@ -1889,7 +1889,7 @@ class World implements ChunkManager{
if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){ if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){
continue; continue;
} }
$distSq = $entity->distanceSquared($pos); $distSq = $entity->getPosition()->distanceSquared($pos);
if($distSq < $currentTargetDistSq){ if($distSq < $currentTargetDistSq){
$currentTargetDistSq = $distSq; $currentTargetDistSq = $distSq;
$currentTarget = $entity; $currentTarget = $entity;