-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.php
More file actions
46 lines (32 loc) · 1.08 KB
/
Main.php
File metadata and controls
46 lines (32 loc) · 1.08 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
41
42
43
44
45
46
<?php
namespace Example;
use pocketmine\plugin\PluginBase;
use pocketmine\Player;
use pocketmine\event\Listener;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\utils\Config;
use pocketmine\utils\TextFormat;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\math\Vector3;
class Example extends PluginBase implements Listener{
/** @var string AUTHOR Plugin author(s) */
const AUTHOR = "Legoboy0215";
/** @var string VERSION Plugin version */
const VERSION = "1.0.0";
/** @var string PREFIX Plugin message prefix */
const PREFIX = "[Plugin]";
public function onEnable(){
$this->getServer()->getPluginManager()->registerEvents($this, $this);
if(!file_exists($this->getDataFolder())){
@mkdir($this->getDataFolder());
}
$this->config = new Config($this->getDataFolder() . "settings.yml", Config::YAML);
$this->config->save();
$this->getLogger()->info(TextFormat::GREEN . "Plugin started!");
}
public function onDisable(){
$this->config->save();
}
}