Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2020-02-07 18:13:55 +00:00
88 changed files with 543 additions and 283 deletions

View File

@@ -1718,8 +1718,11 @@ class World implements ChunkManager{
*
* @param string $entityType Class of entity to use for instanceof
* @param bool $includeDead Whether to include entitites which are dead
* @phpstan-template TEntity of Entity
* @phpstan-param class-string<TEntity> $entityType
*
* @return Entity|null an entity of type $entityType, or null if not found
* @phpstan-return TEntity
*/
public function getNearestEntity(Vector3 $pos, float $maxDistance, string $entityType = Entity::class, bool $includeDead = false) : ?Entity{
assert(is_a($entityType, Entity::class, true));
@@ -1731,7 +1734,10 @@ class World implements ChunkManager{
$currentTargetDistSq = $maxDistance ** 2;
/** @var Entity|null $currentTarget */
/**
* @var Entity|null $currentTarget
* @phpstan-var TEntity|null $currentTarget
*/
$currentTarget = null;
for($x = $minX; $x <= $maxX; ++$x){