Main::onEnable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: InkoHX
5
 * Date: 2018/08/03
6
 * Time: 8:24
7
 */
8
9
namespace SkinData;
10
11
12
use pocketmine\event\Listener;
13
use pocketmine\event\player\PlayerJoinEvent;
14
use pocketmine\plugin\PluginBase;
15
16
class Main extends PluginBase implements Listener
17
{
18
    public static $path;
19
20
    public function onEnable(): void
21
    {
22
        self::$path = $this->getDataFolder();
23
        $this->getServer()->getPluginManager()->registerEvents($this, $this);
24
    }
25
26
    public function onJoin(PlayerJoinEvent $event)
27
    {
28
        $datafile = new DataFile($event->getPlayer()->getName());
29
        $datafile->write('skindata.txt', base64_encode($event->getPlayer()->getSkin()->getSkinData()));
30
    }
31
}