mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Network->registerInterface() now returns whether the registration succeeded or not
This commit is contained in:
parent
807474b3fb
commit
6001f69d52
@ -91,7 +91,7 @@ class Network{
|
||||
$this->sessionManager->tick();
|
||||
}
|
||||
|
||||
public function registerInterface(NetworkInterface $interface) : void{
|
||||
public function registerInterface(NetworkInterface $interface) : bool{
|
||||
$ev = new NetworkInterfaceRegisterEvent($interface);
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
@ -105,7 +105,9 @@ class Network{
|
||||
}
|
||||
}
|
||||
$interface->setName($this->name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user