Last active
December 30, 2015 05:35
-
-
Save PEMapModder/48098c1348f3c38b97e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name ServerKiller | |
* @author PEMapModder | |
* @version 2.0.0 | |
* @api 2.0.0 | |
* @main ServerKiller\ServerKiller | |
*/ | |
namespace ServerKiller; | |
class ServerKiller extends \pocketmine\plugin\PluginBase{ | |
public function onEnable(){ | |
$this->getServer()->getScheduler()->scheduleDelayedTask(new KillerTask($this), 2); | |
} | |
} | |
class KillerTask extends \pocketmine\scheduler\PluginTask{ | |
public function onRun($t){ | |
$this->owner->getLogger()->info("Shutting down server..."); | |
$this->owner->getServer()->shutdown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment