diff --git a/src/command/defaults/GarbageCollectorCommand.php b/src/command/defaults/GarbageCollectorCommand.php index e9ce55f31..47d1dba81 100644 --- a/src/command/defaults/GarbageCollectorCommand.php +++ b/src/command/defaults/GarbageCollectorCommand.php @@ -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); } diff --git a/src/command/defaults/StatusCommand.php b/src/command/defaults/StatusCommand.php index 708693423..d3bbc7b3a 100644 --- a/src/command/defaults/StatusCommand.php +++ b/src/command/defaults/StatusCommand.php @@ -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" ); diff --git a/src/world/World.php b/src/world/World.php index 5914e9d99..d70524243 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -2035,7 +2035,7 @@ class World implements ChunkManager{ /** * @return Chunk[] */ - public function getChunks() : array{ + public function getLoadedChunks() : array{ return $this->chunks; }