Door opening/closing

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-24 19:57:20 +01:00
parent 8b918a7bce
commit 28383deeee
2 changed files with 39 additions and 3 deletions

View File

@ -36,11 +36,13 @@ class LevelAPI{
public function init(){
$this->server->event("player.block.break", array($this, "handle"));
$this->server->event("player.block.place", array($this, "handle"));
$this->server->event("player.block.update", array($this, "handle"));
}
public function handle($data, $event){
switch($event){
case "player.block.place":
case "player.block.update":
console("[DEBUG] EID ".$data["eid"]." placed ".$data["block"].":".$data["meta"]." at X ".$data["x"]." Y ".$data["y"]." Z ".$data["z"], true, true, 2);
$this->setBlock($data["x"], $data["y"], $data["z"], $data["block"], $data["meta"]);
break;