mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +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()){
|
if(!$method->isStatic()){
|
||||||
$priority = EventPriority::NORMAL;
|
$priority = EventPriority::NORMAL;
|
||||||
$ignoreCancelled = false;
|
$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]);
|
$matches[1] = strtoupper($matches[1]);
|
||||||
if(defined("PocketMine\\Event\\EventPriority::".$matches[1])){
|
if(defined("PocketMine\\Event\\EventPriority::".$matches[1])){
|
||||||
$priority = constant("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]);
|
$matches[1] = strtolower($matches[1]);
|
||||||
if($matches[1] === "false"){
|
if($matches[1] === "false"){
|
||||||
$ignoreCancelled = false;
|
$ignoreCancelled = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user