mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
World: renamed getChunks() to getLoadedChunks() (#4393)
This commit is contained in:
parent
2d025bf02f
commit
224d71f272
@ -54,10 +54,10 @@ class GarbageCollectorCommand extends VanillaCommand{
|
||||
$memory = memory_get_usage();
|
||||
|
||||
foreach($sender->getServer()->getWorldManager()->getWorlds() as $world){
|
||||
$diff = [count($world->getChunks()), count($world->getEntities())];
|
||||
$diff = [count($world->getLoadedChunks()), count($world->getEntities())];
|
||||
$world->doChunkGarbageCollection();
|
||||
$world->unloadChunks(true);
|
||||
$chunksCollected += $diff[0] - count($world->getChunks());
|
||||
$chunksCollected += $diff[0] - count($world->getLoadedChunks());
|
||||
$entitiesCollected += $diff[1] - count($world->getEntities());
|
||||
$world->clearCache(true);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ 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->getChunks())) . TextFormat::GREEN . " chunks, " .
|
||||
TextFormat::RED . number_format(count($world->getLoadedChunks())) . TextFormat::GREEN . " chunks, " .
|
||||
TextFormat::RED . number_format(count($world->getEntities())) . TextFormat::GREEN . " entities. " .
|
||||
"Time $timeColor" . round($world->getTickRateTime(), 2) . "ms"
|
||||
);
|
||||
|
@ -2035,7 +2035,7 @@ class World implements ChunkManager{
|
||||
/**
|
||||
* @return Chunk[]
|
||||
*/
|
||||
public function getChunks() : array{
|
||||
public function getLoadedChunks() : array{
|
||||
return $this->chunks;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user