diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 10a3c4c5e..0530d2fbb 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -2679,10 +2679,9 @@ class Server{ TimingsHandler::tick($this->currentTPS <= $this->profilingTickRate); - array_shift($this->tickAverage); - $this->tickAverage[] = $this->currentTPS; - array_shift($this->useAverage); - $this->useAverage[] = $this->currentUse; + $idx = $this->tickCounter % 20; + $this->tickAverage[$idx] = $this->currentTPS; + $this->useAverage[$idx] = $this->currentUse; if(($this->nextTick - $tickTime) < -1){ $this->nextTick = $tickTime;