Added ticking chunk count to /status

closes #5716
This commit is contained in:
Dylan K. Taylor
2023-04-26 17:05:31 +01:00
parent eb130f2906
commit 8102616ff4
2 changed files with 13 additions and 1 deletions

View File

@ -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.