mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Be more concise in event handler timing names
This commit is contained in:
parent
c1cef19f84
commit
9db7e5f0ca
@ -63,6 +63,7 @@ use function realpath;
|
||||
use function shuffle;
|
||||
use function sprintf;
|
||||
use function str_contains;
|
||||
use function str_starts_with;
|
||||
use function strtolower;
|
||||
|
||||
/**
|
||||
@ -651,6 +652,11 @@ class PluginManager{
|
||||
throw new PluginException("Plugin attempted to register event handler " . $handlerName . "() to event " . $event . " while not enabled");
|
||||
}
|
||||
|
||||
$prefix = $plugin->getDescription()->getSrcNamespacePrefix();
|
||||
if(str_starts_with($handlerName, $prefix)){
|
||||
$handlerName = substr($handlerName, strlen($prefix) + 1);
|
||||
}
|
||||
|
||||
$timings = new TimingsHandler($handlerName . "(" . (new \ReflectionClass($event))->getShortName() . ")", group: $plugin->getDescription()->getFullName());
|
||||
|
||||
$registeredListener = new RegisteredListener($handler, $priority, $plugin, $handleCancelled, $timings);
|
||||
|
Loading…
x
Reference in New Issue
Block a user