1212use pocketmine \plugin \PluginBase ;
1313use pocketmine \utils \TextFormat ;
1414use VectorNetworkProject \TheMix \command \PingCommand ;
15+ use VectorNetworkProject \TheMix \command \TpsCommand ;
16+ use VectorNetworkProject \TheMix \event \ThePlayerJoinEvent ;
17+ use VectorNetworkProject \TheMix \event \ThePlayerLoginEvent ;
18+ use VectorNetworkProject \TheMix \event \ThePlayerQuitEvent ;
1519
1620class TheMix extends PluginBase
1721{
@@ -27,16 +31,21 @@ public function onLoad()
2731 public function onEnable ()
2832 {
2933 $ this ->registerCommands ();
30- $ this ->getLogger ()->notice (TextFormat::GREEN . "
34+ $ this ->registerEvents ();
35+ $ this ->getLogger ()->notice (TextFormat::AQUA . '
3136
32- ████████╗██╗ ██╗███████╗ ███╗ ███╗██╗██╗ ██╗
33- ╚══██╔══╝██║ ██║██╔════╝ ████╗ ████║██║╚██╗██╔╝
34- ██║ ███████║█████╗ ██╔████╔██║██║ ╚███╔╝
35- ██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██║ ██╔██╗
36- ██║ ██║ ██║███████╗ ██║ ╚═╝ ██║██║██╔╝ ██╗
37- ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝
3837
39- " );
38+ ███ ▄█ █▄ ▄████████ ▄▄▄▄███▄▄▄▄ ▄█ ▀████ ▐████▀
39+ ▀█████████▄ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███▌ ████▀
40+ ▀███▀▀██ ███ ███ ███ █▀ ███ ███ ███ ███▌ ███ ▐███
41+ ███ ▀ ▄███▄▄▄▄███▄▄ ▄███▄▄▄ ███ ███ ███ ███▌ ▀███▄███▀
42+ ███ ▀▀███▀▀▀▀███▀ ▀▀███▀▀▀ ███ ███ ███ ███▌ ████▀██▄
43+ ███ ███ ███ ███ █▄ ███ ███ ███ ███ ▐███ ▀███
44+ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███▄
45+ ▄████▀ ███ █▀ ██████████ ▀█ ███ █▀ █▀ ████ ███▄
46+
47+
48+ ' );
4049 }
4150
4251 public function onDisable ()
@@ -52,19 +61,20 @@ public static function getInstance(): TheMix
5261 return self ::$ instance ;
5362 }
5463
55- /**
56- * @return DataBase
57- */
58- public static function getDataBase (): DataBase
59- {
60- return new DataBase ();
61- }
62-
6364 private function registerCommands (): void
6465 {
6566 $ commands = [
66- new PingCommand ($ this )
67+ new PingCommand ($ this ),
68+ new TpsCommand ($ this )
6769 ];
6870 $ this ->getServer ()->getCommandMap ()->registerAll ($ this ->getName (), $ commands );
6971 }
72+
73+ private function registerEvents (): void
74+ {
75+ $ plm = $ this ->getServer ()->getPluginManager ();
76+ $ plm ->registerEvents (new ThePlayerLoginEvent (), $ this );
77+ $ plm ->registerEvents (new ThePlayerJoinEvent (), $ this );
78+ $ plm ->registerEvents (new ThePlayerQuitEvent (), $ this );
79+ }
7080}
0 commit comments