diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 14b92e232..ed5f26b96 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -2649,10 +2649,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;