mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 12:48:32 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
commit
b80d7a57e3
@ -23,10 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\timings;
|
namespace pocketmine\timings;
|
||||||
|
|
||||||
use pocketmine\entity\Living;
|
|
||||||
use pocketmine\Server;
|
use pocketmine\Server;
|
||||||
use pocketmine\utils\Utils;
|
use pocketmine\utils\Utils;
|
||||||
use function count;
|
|
||||||
use function hrtime;
|
use function hrtime;
|
||||||
use function implode;
|
use function implode;
|
||||||
use function spl_object_id;
|
use function spl_object_id;
|
||||||
@ -77,19 +75,6 @@ class TimingsHandler{
|
|||||||
$result[] = "# Version " . Server::getInstance()->getVersion();
|
$result[] = "# Version " . Server::getInstance()->getVersion();
|
||||||
$result[] = "# " . Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion();
|
$result[] = "# " . Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion();
|
||||||
|
|
||||||
$entities = 0;
|
|
||||||
$livingEntities = 0;
|
|
||||||
foreach(Server::getInstance()->getWorldManager()->getWorlds() as $world){
|
|
||||||
$entities += count($world->getEntities());
|
|
||||||
foreach($world->getEntities() as $e){
|
|
||||||
if($e instanceof Living){
|
|
||||||
++$livingEntities;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result[] = "# Entities " . $entities;
|
|
||||||
$result[] = "# LivingEntities " . $livingEntities;
|
|
||||||
$result[] = "# FormatVersion " . self::FORMAT_VERSION;
|
$result[] = "# FormatVersion " . self::FORMAT_VERSION;
|
||||||
|
|
||||||
$sampleTime = hrtime(true) - self::$timingStart;
|
$sampleTime = hrtime(true) - self::$timingStart;
|
||||||
|
@ -286,7 +286,7 @@ class WorldManager{
|
|||||||
$centerX = $spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE;
|
$centerX = $spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE;
|
||||||
$centerZ = $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE;
|
$centerZ = $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE;
|
||||||
|
|
||||||
$selected = iterator_to_array((new ChunkSelector())->selectChunks(8, $centerX, $centerZ));
|
$selected = iterator_to_array((new ChunkSelector())->selectChunks(8, $centerX, $centerZ), preserve_keys: false);
|
||||||
$done = 0;
|
$done = 0;
|
||||||
$total = count($selected);
|
$total = count($selected);
|
||||||
foreach($selected as $index){
|
foreach($selected as $index){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user