Updated plugins

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-26 03:01:21 +01:00
parent ea6fe8312a
commit 1b47a716d3
2 changed files with 7 additions and 9 deletions

View File

@ -2,7 +2,7 @@
/*
__PocketMine Plugin__
name=Example Plugin
name=ExamplePlugin
version=0.0.1
author=shoghicp
class=ExamplePlugin

View File

@ -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;
}