mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Updated plugins
This commit is contained in:
parent
ea6fe8312a
commit
1b47a716d3
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
__PocketMine Plugin__
|
||||
name=Example Plugin
|
||||
name=ExamplePlugin
|
||||
version=0.0.1
|
||||
author=shoghicp
|
||||
class=ExamplePlugin
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user