Main   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onEnable() 0 5 1
A onJoin() 0 5 1
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
}