Merge branch 'minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2023-03-29 23:22:02 +01:00
8 changed files with 81 additions and 13 deletions

View File

@ -26,6 +26,7 @@ declare(strict_types=1);
*/
namespace pocketmine\event;
use pocketmine\timings\Timings;
use function get_class;
abstract class Event{
@ -50,6 +51,9 @@ abstract class Event{
throw new \RuntimeException("Recursive event call detected (reached max depth of " . self::MAX_EVENT_CALL_DEPTH . " calls)");
}
$timings = Timings::getEventTimings($this);
$timings->startTiming();
$handlerList = HandlerListManager::global()->getListFor(get_class($this));
++self::$eventCallDepth;
@ -66,6 +70,7 @@ abstract class Event{
}
}finally{
--self::$eventCallDepth;
$timings->stopTiming();
}
}
}