mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
More flexible match on plugin registration
This commit is contained in:
parent
0422540114
commit
b03ef8b61c
@ -619,13 +619,13 @@ class PluginManager{
|
||||
if(!$method->isStatic()){
|
||||
$priority = EventPriority::NORMAL;
|
||||
$ignoreCancelled = false;
|
||||
if(preg_match("/^[\t ]*\\* @priority ([a-zA-Z]{1,})$/m", (string) $method->getDocComment(), $matches) > 0){
|
||||
if(preg_match("/^[\t ]*\\* @priority[\t ]{1,}([a-zA-Z]{1,})$/m", (string) $method->getDocComment(), $matches) > 0){
|
||||
$matches[1] = strtoupper($matches[1]);
|
||||
if(defined("PocketMine\\Event\\EventPriority::".$matches[1])){
|
||||
$priority = constant("PocketMine\\Event\\EventPriority::".$matches[1]);
|
||||
}
|
||||
}
|
||||
if(preg_match("/^[\t ]*\\* @ignoreCancelled ([a-zA-Z]{1,})$/m", (string) $method->getDocComment(), $matches) > 0){
|
||||
if(preg_match("/^[\t ]*\\* @ignoreCancelled[\t ]{1,}([a-zA-Z]{1,})$/m", (string) $method->getDocComment(), $matches) > 0){
|
||||
$matches[1] = strtolower($matches[1]);
|
||||
if($matches[1] === "false"){
|
||||
$ignoreCancelled = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user