mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 07:21:17 +00:00
Updated plugins
This commit is contained in:
parent
ea6fe8312a
commit
1b47a716d3
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
__PocketMine Plugin__
|
__PocketMine Plugin__
|
||||||
name=Example Plugin
|
name=ExamplePlugin
|
||||||
version=0.0.1
|
version=0.0.1
|
||||||
author=shoghicp
|
author=shoghicp
|
||||||
class=ExamplePlugin
|
class=ExamplePlugin
|
||||||
|
@ -2,25 +2,23 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
__PocketMine Plugin__
|
__PocketMine Plugin__
|
||||||
name=Reactor As Water
|
name=ReactorAsWater
|
||||||
description=Replaces the Nether Reactor with Water
|
description=Replaces the Nether Reactor with Water
|
||||||
version=0.0.1
|
version=0.0.2
|
||||||
author=shoghicp
|
author=shoghicp
|
||||||
class=ReactorAsWater
|
class=ReactorAsWater
|
||||||
api=false
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class ReactorAsWater{
|
class ReactorAsWater{
|
||||||
private $api, $server;
|
private $api;
|
||||||
public function __construct($api, $server = false){
|
public function __construct($api, $server = false){
|
||||||
$this->api = $api;
|
$this->api = $api;
|
||||||
$this->server = $server;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
$this->server->addHandler("player.block.action", array($this, "handle"), 15); //Priority higher that API
|
$this->api->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.equipment.change", array($this, "handle"), 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -28,7 +26,7 @@ class ReactorAsWater{
|
|||||||
switch($event){
|
switch($event){
|
||||||
case "player.equipment.change":
|
case "player.equipment.change":
|
||||||
if($data["block"] === 247){
|
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["block"] = 9;
|
||||||
$data["meta"] = 0;
|
$data["meta"] = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user