From 2e7f5e63d653609ceee9b65c44fc7b11ad325ae0 Mon Sep 17 00:00:00 2001 From: Josh North Date: Fri, 20 Jul 2018 12:31:30 -0400 Subject: [PATCH 1/2] Update 'AdminMail/README.md' --- AdminMail/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AdminMail/README.md b/AdminMail/README.md index 972d106..331f7c0 100644 --- a/AdminMail/README.md +++ b/AdminMail/README.md @@ -1,9 +1,9 @@ -# AdminMail - -PMMP plugin to email admins on some server events - -Tested on 3.0.0-ALPHA5. - -Edit config.yml with the address to send to. Your server will need to be set up to send email properly via php. - +# AdminMail + +PMMP plugin to email admins on some server events + +Tested on 3.0.0 and 4.0.0. + +Edit config.yml with the address to send to. Your server will need to be set up to send email properly via php. + PNAME will be replaced with player name \ No newline at end of file From 8b2c42a41decd4b8f1502585fa2df751a1c5724a Mon Sep 17 00:00:00 2001 From: Josh North Date: Fri, 20 Jul 2018 12:32:31 -0400 Subject: [PATCH 2/2] fix 4.0.0 issues --- AdminMail/src/AdminMail/EmailTask.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AdminMail/src/AdminMail/EmailTask.php b/AdminMail/src/AdminMail/EmailTask.php index 160369e..3896679 100644 --- a/AdminMail/src/AdminMail/EmailTask.php +++ b/AdminMail/src/AdminMail/EmailTask.php @@ -4,7 +4,7 @@ namespace AdminMail; use pocketmine\scheduler\Task; use pocketmine\Player; -use pocketmine\event\player\PlayerJoinEvent; +use pocketmine\event\player\PlayerLoginEvent; use pocketmine\plugin\PluginBase; use pocketmine\event\Listener; use pocketmine\command\Command; @@ -22,8 +22,7 @@ class EmailTask extends Task { } public function onRun(int $currentTick) { - $player = $this->getOwner()->getServer()->getPlayer($this->playername); - $name = $player->getName(); + $name = $this->playername; $admin = $this->adminmail; $admin1 = $this->adminsubject; $admin1 = str_replace("PNAME", $name, $admin1);