1010
1111use pocketmine \plugin \PluginBase ;
1212use pocketmine \utils \TextFormat ;
13- use VectorNetworkProject \TheMix \command \PingCommand ;
14- use VectorNetworkProject \TheMix \command \TpsCommand ;
13+ use tokyo \pmmp \libform \FormApi ;
14+ use VectorNetworkProject \TheMix \command \defaults \ModeratorCommand ;
15+ use VectorNetworkProject \TheMix \command \defaults \PingCommand ;
16+ use VectorNetworkProject \TheMix \command \defaults \TpsCommand ;
17+ use VectorNetworkProject \TheMix \command \Permissions ;
18+ use VectorNetworkProject \TheMix \event \TheBlockBreakEvent ;
19+ use VectorNetworkProject \TheMix \event \TheBlockPlaceEvent ;
1520use VectorNetworkProject \TheMix \event \ThePlayerJoinEvent ;
1621use VectorNetworkProject \TheMix \event \ThePlayerLoginEvent ;
1722use VectorNetworkProject \TheMix \event \ThePlayerQuitEvent ;
23+ use VectorNetworkProject \TheMix \game \DefaultConfig ;
1824
1925class TheMix extends PluginBase
2026{
2127 /* @var TheMix $instance */
2228 private static $ instance = null ;
2329
30+ public const PLUGIN_CONFIG_VERSION = 1 ;
31+
2432 public function onLoad ()
2533 {
2634 self ::$ instance = $ this ;
35+ DefaultConfig::init ();
2736 $ this ->getLogger ()->notice ('Loading System... ' );
2837 }
2938
3039 public function onEnable ()
3140 {
41+ Permissions::registerPermissions ();
42+ FormApi::register ($ this );
3243 $ this ->registerCommands ();
3344 $ this ->registerEvents ();
45+ $ this ->getServer ()->loadLevel (DefaultConfig::getStageLevelName ())
46+ ? $ this ->getLogger ()->notice ('Loaded stage. ' )
47+ : $ this ->getServer ()->generateLevel (DefaultConfig::getStageLevelName ());
3448 $ this ->getLogger ()->notice (TextFormat::AQUA .'
3549
3650
37- ███ ▄█ █▄ ▄████████ ▄▄▄▄███▄▄▄▄ ▄█ ▀████ ▐████▀
38- ▀█████████▄ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███▌ ████▀
39- ▀███▀▀██ ███ ███ ███ █▀ ███ ███ ███ ███▌ ███ ▐███
40- ███ ▀ ▄███▄▄▄▄███▄▄ ▄███▄▄▄ ███ ███ ███ ███▌ ▀███▄███▀
41- ███ ▀▀███▀▀▀▀███▀ ▀▀███▀▀▀ ███ ███ ███ ███▌ ████▀██▄
42- ███ ███ ███ ███ █▄ ███ ███ ███ ███ ▐███ ▀███
43- ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███▄
44- ▄████▀ ███ █▀ ██████████ ▀█ ███ █▀ █▀ ████ ███▄
51+ ███ ▄█ █▄ ▄████████ ▄▄▄▄███▄▄▄▄ ▄█ ▀████ ▐████▀
52+ ▀█████████▄ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███▌ ████▀
53+ ▀███▀▀██ ███ ███ ███ █▀ ███ ███ ███ ███▌ ███ ▐███
54+ ███ ▀ ▄███▄▄▄▄███▄▄ ▄███▄▄▄ ███ ███ ███ ███▌ ▀███▄███▀
55+ ███ ▀▀███▀▀▀▀███▀ ▀▀███▀▀▀ ███ ███ ███ ███▌ ████▀██▄
56+ ███ ███ ███ ███ █▄ ███ ███ ███ ███ ▐███ ▀███
57+ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███▄
58+ ▄████▀ ███ █▀ ██████████ ▀█ ███ █▀ █▀ ████ ███▄
4559
4660
4761 ' );
@@ -65,6 +79,7 @@ private function registerCommands(): void
6579 $ commands = [
6680 new PingCommand ($ this ),
6781 new TpsCommand ($ this ),
82+ new ModeratorCommand ($ this ),
6883 ];
6984 $ this ->getServer ()->getCommandMap ()->registerAll ($ this ->getName (), $ commands );
7085 }
@@ -75,5 +90,7 @@ private function registerEvents(): void
7590 $ plm ->registerEvents (new ThePlayerLoginEvent (), $ this );
7691 $ plm ->registerEvents (new ThePlayerJoinEvent (), $ this );
7792 $ plm ->registerEvents (new ThePlayerQuitEvent (), $ this );
93+ $ plm ->registerEvents (new TheBlockBreakEvent (), $ this );
94+ $ plm ->registerEvents (new TheBlockPlaceEvent (), $ this );
7895 }
7996}
0 commit comments