From ca54acd09b21a6e10b3a0c7b3ea19a5e92c0dda4 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sat, 29 Dec 2012 02:19:54 +0100 Subject: [PATCH] Removed example folder (added those examples to the wiki) --- example/ExamplePlugin.php | 34 ------------ example/ReactorAsWater.php | 46 ---------------- example/SpawnChanger.php | 105 ------------------------------------- 3 files changed, 185 deletions(-) delete mode 100644 example/ExamplePlugin.php delete mode 100644 example/ReactorAsWater.php delete mode 100644 example/SpawnChanger.php diff --git a/example/ExamplePlugin.php b/example/ExamplePlugin.php deleted file mode 100644 index 7a32f1553..000000000 --- a/example/ExamplePlugin.php +++ /dev/null @@ -1,34 +0,0 @@ -api = $api; - } - - public function init(){ - $this->api->console->register("example", "Example command", array($this, "handleCommand")); - } - - public function __destruct(){ - - } - - public function handleCommand($cmd, $arg){ - switch($cmd){ - case "example": - console("EXAMPLE!!!"); - break; - } - } - -} \ No newline at end of file diff --git a/example/ReactorAsWater.php b/example/ReactorAsWater.php deleted file mode 100644 index 3315b0382..000000000 --- a/example/ReactorAsWater.php +++ /dev/null @@ -1,46 +0,0 @@ -api = $api; - } - - public function init(){ - $this->api->addHandler("player.block.action", array($this, "handle"), 15); //Priority higher that API - $this->api->addHandler("player.equipment.change", array($this, "handle"), 15); - } - - public function __destruct(){ - - } - - public function handle(&$data, $event){ - switch($event){ - case "player.equipment.change": - if($data["block"] === 247){ - $this->api->player->getByEID($data["eid"])->eventHandler("[ReactorAsWater] Placing water", "server.chat"); - $data["block"] = 9; - $data["meta"] = 0; - } - break; - case "player.block.action": - if($data["block"] === 247){ //nether reactor - $data["block"] = 9; //water source - $data["meta"] = 0; - } - break; - } - } - -} \ No newline at end of file diff --git a/example/SpawnChanger.php b/example/SpawnChanger.php deleted file mode 100644 index 37b41670d..000000000 --- a/example/SpawnChanger.php +++ /dev/null @@ -1,105 +0,0 @@ -api = $api; - } - - public function init(){ - $spawn = $this->api->level->getSpawn(); - $this->path = $this->api->plugin->createConfig($this, array( - "spawnX" => $spawn["x"], - "spawnY" => $spawn["y"], - "spawnZ" => $spawn["z"], - "custom-spawn" => false, - "force-spawn" => false, - )); - $this->config = $this->api->plugin->readYAML($this->path."config.yml"); - if($this->config["custom-spawn"] === false){ - $this->config["spawnX"] = $spawn["x"]; - $this->config["spawnY"] = $spawn["y"]; - $this->config["spawnZ"] = $spawn["z"]; - $this->api->plugin->writeYAML($this->path."config.yml", $this->config); - } - $this->api->addHandler("api.player.offline.get", array($this, "handle"), 15); - $this->api->console->register("spawnchanger", "SpawnChanger init point managing", array($this, "command")); - $this->api->console->register("spawn", "Teleports to spawn", array($this, "command")); - } - - public function __destruct(){ - - } - - public function command($cmd, $args){ - switch($cmd){ - case "spawnchanger": - switch(strtolower(array_shift($args))){ - case "force": - $l = array_shift($args); - if($l != "0" and $l != "1"){ - console("[SpawnChanger] Usage: /spawnchanger force <1 | 0>"); - }else{ - $this->config["force-spawn"] = $l == "0" ? false:true; - if($this->config["force-spawn"] === true){ - console("[SpawnChanger] Forced spawn point"); - }else{ - console("[SpawnChanger] Freed pawn point"); - } - $this->api->plugin->writeYAML($this->path."config.yml", $this->config); - } - break; - case "set": - $z = array_pop($args); - $y = array_pop($args); - $x = array_pop($args); - if($x === null or $y === null or $z === null){ - console("[SpawnChanger] Usage: /spawnchanger set "); - }else{ - $this->config["custom-spawn"] = true; - $this->config["spawnX"] = (float) $x; - $this->config["spawnY"] = (float) $y; - $this->config["spawnZ"] = (float) $z; - console("[SpawnChanger] Spawn point set at X ".$this->config["spawnX"]." Y ".$this->config["spawnY"]." Z ".$this->config["spawnZ"]); - $this->api->plugin->writeYAML($this->path."config.yml", $this->config); - } - break; - default: - console("[SpawnChanger] Always spawn player in spawn point: /spawnchanger force <1 | 0>"); - console("[SpawnChanger] Set the spawn point: /spawnchanger set "); - break; - } - break; - case "spawn": - if($this->api->player->tppos(implode(" ", $args), $this->config["spawnX"], $this->config["spawnY"], $this->config["spawnZ"]) !== false){ - console("[SpawnChanger] Teleported to spawn!"); - }else{ - console("[SpawnChanger] Usage: /spawn "); - } - break; - } - } - - public function handle(&$data, $event){ - switch($event){ - case "api.player.offline.get": - if($this->config["force-spawn"] === true){ - $data["spawn"]["x"] = $this->config["spawnX"]; - $data["spawn"]["y"] = $this->config["spawnY"]; - $data["spawn"]["z"] = $this->config["spawnZ"]; - } - break; - } - } - -} \ No newline at end of file