mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Move block and network namespaces away from PluginManager->callEvent()
the original step that wasn't supposed to cause conflicts, caused messy conflicts... so I might as well do this part too
This commit is contained in:
@ -98,7 +98,7 @@ class Network{
|
||||
$logger->logException($e);
|
||||
}
|
||||
|
||||
$this->server->getPluginManager()->callEvent(new NetworkInterfaceCrashEvent($interface, $e));
|
||||
(new NetworkInterfaceCrashEvent($interface, $e))->call();
|
||||
|
||||
$interface->emergencyShutdown();
|
||||
$this->unregisterInterface($interface);
|
||||
@ -110,7 +110,8 @@ class Network{
|
||||
* @param SourceInterface $interface
|
||||
*/
|
||||
public function registerInterface(SourceInterface $interface){
|
||||
$this->server->getPluginManager()->callEvent($ev = new NetworkInterfaceRegisterEvent($interface));
|
||||
$ev = new NetworkInterfaceRegisterEvent($interface);
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
$interface->start();
|
||||
$this->interfaces[$hash = spl_object_hash($interface)] = $interface;
|
||||
@ -126,7 +127,7 @@ class Network{
|
||||
* @param SourceInterface $interface
|
||||
*/
|
||||
public function unregisterInterface(SourceInterface $interface){
|
||||
$this->server->getPluginManager()->callEvent(new NetworkInterfaceUnregisterEvent($interface));
|
||||
(new NetworkInterfaceUnregisterEvent($interface))->call();
|
||||
unset($this->interfaces[$hash = spl_object_hash($interface)], $this->advancedInterfaces[$hash]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user