diff --git a/src/command/defaults/StatusCommand.php b/src/command/defaults/StatusCommand.php index 7c2884993d..1d7545f0b0 100644 --- a/src/command/defaults/StatusCommand.php +++ b/src/command/defaults/StatusCommand.php @@ -110,7 +110,8 @@ class StatusCommand extends VanillaCommand{ $worldName = $world->getFolderName() !== $world->getDisplayName() ? " (" . $world->getDisplayName() . ")" : ""; $timeColor = $world->getTickRateTime() > 40 ? TextFormat::RED : TextFormat::YELLOW; $sender->sendMessage(TextFormat::GOLD . "World \"{$world->getFolderName()}\"$worldName: " . - TextFormat::RED . number_format(count($world->getLoadedChunks())) . TextFormat::GREEN . " chunks, " . + TextFormat::RED . number_format(count($world->getLoadedChunks())) . TextFormat::GREEN . " loaded chunks, " . + TextFormat::RED . number_format(count($world->getTickingChunks())) . TextFormat::GREEN . " ticking chunks, " . TextFormat::RED . number_format(count($world->getEntities())) . TextFormat::GREEN . " entities. " . "Time $timeColor" . round($world->getTickRateTime(), 2) . "ms" ); diff --git a/src/world/World.php b/src/world/World.php index 607da30cbb..b66e76348b 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -104,6 +104,7 @@ use pocketmine\world\utils\SubChunkExplorer; use function abs; use function array_filter; use function array_key_exists; +use function array_keys; use function array_map; use function array_merge; use function array_sum; @@ -1155,6 +1156,16 @@ class World implements ChunkManager{ $this->chunkTickRadius = $radius; } + /** + * Returns a list of chunk position hashes (as returned by World::chunkHash()) which are currently registered for + * ticking. + * + * @return int[] + */ + public function getTickingChunks() : array{ + return array_keys($this->tickingChunks); + } + /** * Instructs the World to tick the specified chunk, for as long as this chunk ticker (or any other chunk ticker) is * registered to it.