Merge branch 'next-minor'

This commit is contained in:
Dylan K. Taylor
2019-12-12 13:52:14 +00:00
12 changed files with 81 additions and 16 deletions

View File

@ -32,6 +32,8 @@ use pocketmine\scheduler\TaskHandler;
use function dechex;
abstract class Timings{
/** @var bool */
private static $initialized = false;
/** @var TimingsHandler */
public static $fullTickTimer;
@ -113,9 +115,10 @@ abstract class Timings{
public static $pluginTaskTimingMap = [];
public static function init() : void{
if(self::$serverTickTimer instanceof TimingsHandler){
if(self::$initialized){
return;
}
self::$initialized = true;
self::$fullTickTimer = new TimingsHandler("Full Server Tick");
self::$serverTickTimer = new TimingsHandler("** Full Server Tick", self::$fullTickTimer);

View File

@ -168,7 +168,7 @@ class TimingsHandler{
public function stopTiming() : void{
if(self::$enabled){
if(--$this->timingDepth !== 0 or $this->start === 0){
if(--$this->timingDepth !== 0 or $this->start == 0){
return;
}