From f4cb6f9ca0137f77ca9f45b0e9b2af711b5a651d Mon Sep 17 00:00:00 2001 From: LDX Date: Thu, 2 Apr 2015 23:07:57 -0400 Subject: [PATCH 1/5] Update Main.php --- src/LDX/iProtector/Main.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/LDX/iProtector/Main.php b/src/LDX/iProtector/Main.php index 165eb41..2719e86 100644 --- a/src/LDX/iProtector/Main.php +++ b/src/LDX/iProtector/Main.php @@ -26,17 +26,17 @@ public function onEnable() { file_put_contents($this->getDataFolder() . "areas.json","[]"); } if(!file_exists($this->getDataFolder() . "config.yml")) { - $c = $this->getResource("config.yml"); - $o = stream_get_contents($c); - fclose($c); - file_put_contents($this->getDataFolder() . "config.yml",str_replace("{DEFAULT}",$this->getServer()->getDefaultLevel()->getName(),$o)); + $oc = $this->getResource("config.yml"); + $o = stream_get_contents($oc); + fclose($oc); + file_put_contents($this->getDataFolder() . "config.yml",str_replace("DEFAULT",$this->getServer()->getDefaultLevel()->getName(),$o)); } $this->areas = array(); $data = json_decode(file_get_contents($this->getDataFolder() . "areas.json"),true); foreach($data as $datum) { $area = new Area($datum["name"],$datum["flags"],$datum["pos1"],$datum["pos2"],$datum["level"],$datum["whitelist"],$this); } - $c = $this->getConfig()->getAll(); + $c = yaml_parse(file_get_contents($this->getDataFolder() . "config.yml")); $this->god = $c["Default"]["God"]; $this->edit = $c["Default"]["Edit"]; $this->touch = $c["Default"]["Touch"]; @@ -44,6 +44,7 @@ public function onEnable() { foreach($c["Worlds"] as $level => $flags) { $this->levels[$level] = $flags; } + print_r($c); } public function onCommand(CommandSender $p,Command $cmd,$label,array $args) { From c8f20b348c59599da87406359adbc99363a16cba Mon Sep 17 00:00:00 2001 From: LDX Date: Thu, 2 Apr 2015 23:13:42 -0400 Subject: [PATCH 2/5] Update Main.php --- src/LDX/iProtector/Main.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/LDX/iProtector/Main.php b/src/LDX/iProtector/Main.php index 2719e86..89828a6 100644 --- a/src/LDX/iProtector/Main.php +++ b/src/LDX/iProtector/Main.php @@ -26,9 +26,9 @@ public function onEnable() { file_put_contents($this->getDataFolder() . "areas.json","[]"); } if(!file_exists($this->getDataFolder() . "config.yml")) { - $oc = $this->getResource("config.yml"); - $o = stream_get_contents($oc); - fclose($oc); + $c = $this->getResource("config.yml"); + $o = stream_get_contents($c); + fclose($c); file_put_contents($this->getDataFolder() . "config.yml",str_replace("DEFAULT",$this->getServer()->getDefaultLevel()->getName(),$o)); } $this->areas = array(); @@ -44,7 +44,6 @@ public function onEnable() { foreach($c["Worlds"] as $level => $flags) { $this->levels[$level] = $flags; } - print_r($c); } public function onCommand(CommandSender $p,Command $cmd,$label,array $args) { @@ -368,4 +367,3 @@ public function canGetHurt($p) { } } -?> From 9c3579a9303e6f8a3c0ffea11e93b2defe365f8b Mon Sep 17 00:00:00 2001 From: LDX Date: Thu, 2 Apr 2015 23:15:21 -0400 Subject: [PATCH 3/5] Update Area.php --- src/LDX/iProtector/Area.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/LDX/iProtector/Area.php b/src/LDX/iProtector/Area.php index a79f9ef..8756e8a 100644 --- a/src/LDX/iProtector/Area.php +++ b/src/LDX/iProtector/Area.php @@ -118,4 +118,3 @@ public function delete() { } } -?> From bafd29da9726480a49d9b219b2fd3330d56eca71 Mon Sep 17 00:00:00 2001 From: LDX Date: Thu, 2 Apr 2015 23:17:26 -0400 Subject: [PATCH 4/5] Update plugin.yml --- plugin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index 4eaad60..36ff043 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,10 +1,10 @@ name: iProtector author: LDX -version: "3.0" +version: 3.1a main: LDX\iProtector\Main load: POSTWORLD api: [1.9.0] -website: https://github.com/LDX-MCPE/iProtector +website: "https://github.com/LDX-MCPE/iProtector" commands: area: description: "Allows you to manage areas." From 453ee91ad1c02d737f635d21d7a671ed8f0f8551 Mon Sep 17 00:00:00 2001 From: LDX Date: Thu, 2 Apr 2015 23:18:27 -0400 Subject: [PATCH 5/5] Update config.yml --- resources/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/config.yml b/resources/config.yml index bf6cb60..e786389 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -12,10 +12,10 @@ Default: # Keep players from touching blocks and activating things like chests? Touch: false -# Settings for individual worlds: +# Settings for unprotected areas in individual worlds: Worlds: - {DEFAULT}: + DEFAULT: # Keep players from getting hurt? God: false