Posibility of changing data for handlers, and canceling it

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-25 20:15:08 +01:00
parent bf24a937b2
commit 504b37cfaa
7 changed files with 72 additions and 21 deletions

View File

@ -29,7 +29,7 @@ class EntityAPI{
private $server;
function __construct($server){
$this->server = $server;
$this->server->addHandler("onPlayerDeath", array($this, "handle"), 1);
$this->server->addHandler("player.death", array($this, "handle"), 1);
}
public function init(){
@ -38,7 +38,7 @@ class EntityAPI{
public function handle($data, $event){
switch($event){
case "onPlayerDeath":
case "player.death":
$message = $data["name"];
if(is_numeric($data["cause"]) and isset($this->entities[$data["cause"]])){
$e = $this->api->entity->get($data["cause"]);