diff --git a/example/ExamplePlugin.php b/example/ExamplePlugin.php index 1663c9aa..1ad4f806 100644 --- a/example/ExamplePlugin.php +++ b/example/ExamplePlugin.php @@ -2,7 +2,7 @@ /* __PocketMine Plugin__ -name=Example Plugin +name=ExamplePlugin version=0.0.1 author=shoghicp class=ExamplePlugin diff --git a/example/ReactorAsWater.php b/example/ReactorAsWater.php index 9f95881c..701b00ee 100644 --- a/example/ReactorAsWater.php +++ b/example/ReactorAsWater.php @@ -2,25 +2,23 @@ /* __PocketMine Plugin__ -name=Reactor As Water +name=ReactorAsWater description=Replaces the Nether Reactor with Water -version=0.0.1 +version=0.0.2 author=shoghicp class=ReactorAsWater -api=false */ class ReactorAsWater{ - private $api, $server; + private $api; public function __construct($api, $server = false){ $this->api = $api; - $this->server = $server; } public function init(){ - $this->server->addHandler("player.block.action", array($this, "handle"), 15); //Priority higher that API - $this->server->addHandler("player.equipment.change", array($this, "handle")); + $this->api->addHandler("player.block.action", array($this, "handle"), 15); //Priority higher that API + $this->api->addHandler("player.equipment.change", array($this, "handle"), 15); } @@ -28,7 +26,7 @@ class ReactorAsWater{ switch($event){ case "player.equipment.change": if($data["block"] === 247){ - $this->api->player->getByEID($data["eid"])->eventHandler("[ReactorAsWater] You'll place water with the Nether Reactor", "server.chat"); + $this->api->player->getByEID($data["eid"])->eventHandler("[ReactorAsWater] Placing water", "server.chat"); $data["block"] = 9; $data["meta"] = 0; }