Added UpdateNotifyEvent

This commit is contained in:
Dylan K. Taylor
2017-06-15 11:16:13 +01:00
parent 478e954b3f
commit eb05f2ecde
2 changed files with 47 additions and 0 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\updater;
use pocketmine\event\server\UpdateNotifyEvent;
use pocketmine\Player;
use pocketmine\Server;
use pocketmine\utils\TextFormat;
@ -61,6 +62,7 @@ class AutoUpdater{
$this->updateInfo = $updateInfo;
$this->checkUpdate();
if($this->hasUpdate()){
$this->server->getPluginManager()->callEvent(new UpdateNotifyEvent($this));
if($this->server->getProperty("auto-updater.on-update.warn-console", true)){
$this->showConsoleUpdate();
}