Skip to content
This repository was archived by the owner on Oct 21, 2018. It is now read-only.

Commit 734db9c

Browse files
author
Luke Darling
committed
Fixed #16
1 parent 4094ba7 commit 734db9c

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: VoteReward
22
main: LDX\VoteReward\Main
3-
version: 3.
4-
api: [1.0.0, 2.0.0]
3+
version: 3.0
4+
api: [1.12.0, 2.0.0]
55
author: LDX
66
website: "http://votereward.mcpe.me"
77
load: POSTWORLD

src/LDX/VoteReward/Main.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ class Main extends PluginBase {
1717
private $debug = false;
1818
public $queue = [];
1919

20+
public function onLoad() {
21+
if(file_exists($this->getDataFolder() . "config.yml")) {
22+
$c = $this->getConfig()->getAll();
23+
if(isset($c["API-Key"])) {
24+
if(trim($c["API-Key"]) != "") {
25+
if(!is_dir($this->getDataFolder() . "Lists/")) {
26+
mkdir($this->getDataFolder() . "Lists/");
27+
}
28+
file_put_contents($this->getDataFolder() . "Lists/minecraftpocket-servers.com.vrc", "{\"website\":\"http://minecraftpocket-servers.com/\",\"check\":\"http://minecraftpocket-servers.com/api-vrc/?object=votes&element=claim&key=" . $c["API-Key"] . "&username={USERNAME}\",\"claim\":\"http://minecraftpocket-servers.com/api-vrc/?action=post&object=votes&element=claim&key=" . $c["API-Key"] . "&username={USERNAME}\"}");
29+
rename($this->getDataFolder() . "config.yml", $this->getDataFolder() . "config.old.yml");
30+
$this->getLogger()->info("§eConverting API key to VRC file...");
31+
} else {
32+
rename($this->getDataFolder() . "config.yml", $this->getDataFolder() . "config.old.yml");
33+
$this->getLogger()->info("§eSetting up new configuration file...");
34+
}
35+
}
36+
}
37+
}
38+
2039
public function onEnable() {
2140
$this->reload();
2241
}

src/LDX/VoteReward/Utils.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace LDX\VoteReward;
44

5-
use pocketmine\Player;
6-
75
class Utils {
86

97
public static function hasPermission($player, $permission) {

0 commit comments

Comments
 (0)