mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-19 17:36:34 +00:00
Fixed plugins loading?
This commit is contained in:
parent
be78530175
commit
8f6ed22158
@ -178,10 +178,9 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($this->apiList as $a){
|
foreach($this->apiList as $ob){
|
||||||
if(method_exists($a[1], "init")){
|
if(is_callable(array($ob, "init"))){
|
||||||
$a[1]->init();
|
$ob->init();
|
||||||
usleep(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,7 +379,7 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
|
|||||||
}
|
}
|
||||||
require_once($file);
|
require_once($file);
|
||||||
$this->$name = new $class($this->server);
|
$this->$name = new $class($this->server);
|
||||||
$this->apiList[] = array($name, $this->$name);
|
$this->apiList[] = $this->$name;
|
||||||
console("[INFO] API ".$name." [".$class."] loaded");
|
console("[INFO] API ".$name." [".$class."] loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,8 +465,13 @@ class PocketMinecraftServer extends stdClass{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while(false !== ($evn = $events->fetchArray(SQLITE3_ASSOC))){
|
while(false !== ($evn = $events->fetchArray(SQLITE3_ASSOC))){
|
||||||
$evid = (int) $evn["ID"];
|
$ev = $this->events[(int) $evn["ID"]];
|
||||||
$this->responses[$evid] = call_user_func($this->events[$evid], $data, $event);
|
if(is_array($ev)){
|
||||||
|
$method = $ev[1];
|
||||||
|
$this->responses[(int) $evn["ID"]] = $ev[0]->$method($data, $event);
|
||||||
|
}else{
|
||||||
|
$this->responses[(int) $evn["ID"]] = $ev($data, $event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$events->finalize();
|
$events->finalize();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user