-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoader.php
More file actions
40 lines (33 loc) · 1.26 KB
/
Copy pathLoader.php
File metadata and controls
40 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Xila\Bazaar;
use pocketmine\plugin\PluginBase;
// use muqsit\invmenu\InvMenuHandler;
class Loader extends PluginBase{
/** code piece, so the Loader Class can be called from Outsides
To Be honest i would have called this class Main.php instead of Loader.php
*/
public static self $instance;
public static function getInstance(): Loader
{
return self::$instance;
}
public function onLoad(): void
{
self::$instance = $this;
}
public function onEnable(): void{
/** register EventListener */
$this->getServer()->getPluginManager()->registerEvents(new EventListener(), $this);
/** register InvMenu for later, rn i would add it as comment
* if(!InvMenuHandler::isRegistered()){
* InvMenuHandler::register($this);
* }
*/
/** how to register commands
$this->getServer()->getCommandMap()->registerAll('Commands', [
new exampleCommand1("exampleCommand1", "this runs the exampleCommand1", "/exampleCommand1", array("Alias1", "Alias2")),
new exampleCommand2("exampleCommand2", "this runs exampleCommand2", "/exampleCommand2", array("Alias3")),
]);
*/
}
}