From 858d4a2ed2774a62410cab0c11c0709859ee266a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Apr 2023 23:35:14 +0100 Subject: [PATCH 1/3] changelog: fixed indentation I have no idea what happened here... --- changelogs/4.19.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/changelogs/4.19.md b/changelogs/4.19.md index de5da5340..9befb4e0b 100644 --- a/changelogs/4.19.md +++ b/changelogs/4.19.md @@ -54,13 +54,13 @@ Released 11th April 2023. ### `pocketmine\timings` - The following API constants have been deprecated: -- `Timings::INCLUDED_BY_OTHER_TIMINGS_PREFIX` - this is superseded by timings group support (see `Timings::GROUP_BREAKDOWN`) + - `Timings::INCLUDED_BY_OTHER_TIMINGS_PREFIX` - this is superseded by timings group support (see `Timings::GROUP_BREAKDOWN`) - The following API constants have been added: -- `Timings::GROUP_BREAKDOWN` - this group makes a timer appear in the `Minecraft - Breakdown` section of a timings report + - `Timings::GROUP_BREAKDOWN` - this group makes a timer appear in the `Minecraft - Breakdown` section of a timings report - The following API methods have been added: -- `public TimingsHandler->getGroup() : string` - returns the name of the table in which this timer will appear in a timings report + - `public TimingsHandler->getGroup() : string` - returns the name of the table in which this timer will appear in a timings report - The following API methods have changed signatures: -- `TimingsHandler->__construct()` now accepts an additional, optional `string $group` parameter, which defaults to `Minecraft`. + - `TimingsHandler->__construct()` now accepts an additional, optional `string $group` parameter, which defaults to `Minecraft`. ### `pocketmine\world` #### Highlights From a6e79c50042d28ac64a4094b67fcc6a9fd9faff6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Apr 2023 23:45:01 +0100 Subject: [PATCH 2/3] TimingsHandler: remove useless paste metadata these fields are not used by any version of timings, so this code is redundant. --- src/timings/TimingsHandler.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/timings/TimingsHandler.php b/src/timings/TimingsHandler.php index b77610a65..d43b432bc 100644 --- a/src/timings/TimingsHandler.php +++ b/src/timings/TimingsHandler.php @@ -23,10 +23,8 @@ declare(strict_types=1); namespace pocketmine\timings; -use pocketmine\entity\Living; use pocketmine\Server; use pocketmine\utils\Utils; -use function count; use function hrtime; use function implode; use function spl_object_id; @@ -77,19 +75,6 @@ class TimingsHandler{ $result[] = "# Version " . Server::getInstance()->getVersion(); $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; $sampleTime = hrtime(true) - self::$timingStart; From ba62e0f9cbe0c21fccc4fb80bfc34f724009a050 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Apr 2023 23:55:34 +0100 Subject: [PATCH 3/3] WorldManager: fixed borked pre-generation for new worlds' spawn terrain perhaps directly altering the behaviour of selectChunks() wasn't a good idea? ... --- src/world/WorldManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/WorldManager.php b/src/world/WorldManager.php index 5632c960b..1124d513d 100644 --- a/src/world/WorldManager.php +++ b/src/world/WorldManager.php @@ -286,7 +286,7 @@ class WorldManager{ $centerX = $spawnLocation->getFloorX() >> 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; $total = count($selected); foreach($selected as $index){