diff --git a/plugin.yml b/plugin.yml index af9376b..f2c8f88 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: AlwaysSpawn authors: [Philip Shilling] -version: 2.2.4 -api: [4.0.0] +version: 2.2.5 +api: [5.0.0] main: philipshilling\alwaysspawn\Loader load: STARTUP -description: "Force your users to spawn every time they login!" \ No newline at end of file +description: "Force your users to spawn every time they login!" diff --git a/src/philipshilling/alwaysspawn/Loader.php b/src/philipshilling/alwaysspawn/Loader.php index f25a45c..14d7a96 100644 --- a/src/philipshilling/alwaysspawn/Loader.php +++ b/src/philipshilling/alwaysspawn/Loader.php @@ -3,6 +3,7 @@ namespace philipshilling\alwaysspawn; use pocketmine\event\Listener; +use pocketmine\event\player\PlayerJoinEvent; use pocketmine\event\player\PlayerLoginEvent; use pocketmine\plugin\PluginBase as Plugin; @@ -11,8 +12,7 @@ public function onEnable(): void{ $this->getServer()->getPluginManager()->registerEvents($this, $this); } - public function onPlayerLogin(PlayerLoginEvent $event){ + public function onPlayerJoin(PlayerJoinEvent $event){ $event->getPlayer()->teleport($this->getServer()->getWorldManager()->getDefaultWorld()->getSafeSpawn()); } - -} \ No newline at end of file +}