Updated event names

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-12 17:35:32 +01:00
parent 62a7461bbd
commit baec22208f
4 changed files with 12 additions and 30 deletions

View file

@ -112,7 +112,7 @@ class Player{
public function eventHandler($data, $event){
switch($event){
case "player.item.pick":
case "player.pickup":
if($data["eid"] === $this->eid){
$data["eid"] = 0;
}
@ -124,7 +124,7 @@ class Player{
}
$this->dataPacket(MC_PLAYER_EQUIPMENT, $data);
break;
case "world.block.change":
case "block.change":
$this->dataPacket(MC_UPDATE_BLOCK, $data);
break;
case "entity.move":
@ -148,7 +148,7 @@ class Player{
"eid" => $data->eid,
));
break;
case "server.time.change":
case "server.time":
$this->dataPacket(MC_SET_TIME, array(
"time" => $data,
));
@ -323,14 +323,14 @@ class Player{
$this->entity->data["clientID"] = $this->clientID;
$this->server->api->entity->spawnAll($this);
$this->server->api->entity->spawnToAll($this->eid);
$this->server->event("server.time.change", array($this, "eventHandler"));
$this->server->event("server.timee", array($this, "eventHandler"));
$this->server->event("server.chat", array($this, "eventHandler"));
$this->server->event("entity.remove", array($this, "eventHandler"));
$this->server->event("entity.move", array($this, "eventHandler"));
$this->server->event("entity.animate", array($this, "eventHandler"));
$this->server->event("player.equipment.change", array($this, "eventHandler"));
$this->server->event("player.item.pick", array($this, "eventHandler"));
$this->server->event("world.block.change", array($this, "eventHandler"));
$this->server->event("player.pickup", array($this, "eventHandler"));
$this->server->event("block.change", array($this, "eventHandler"));
console("[DEBUG] Player with EID ".$this->eid." \"".$this->username."\" spawned!", true, true, 2);
$this->eventHandler(new Container($this->server->motd), "server.chat");

View file

@ -93,8 +93,8 @@ class PocketMinecraftServer{
}
public function loadEvents(){
$this->event("player.new", array($this, "eventHandler"));
$this->action(500000, '$this->time += (int) ($this->timePerSecond / 2);$this->api->dhandle("server.time.change", $this->time);');
$this->event("player.add", array($this, "eventHandler"));
$this->action(500000, '$this->time += (int) ($this->timePerSecond / 2);$this->api->dhandle("server.time", $this->time);');
$this->action(5000000, 'if($this->difficulty < 2){$this->api->dhandle("server.regeneration", 1);}');
$this->action(1000000 * 60, '$this->reloadConfig();');
$this->action(1000000 * 60 * 10, '$this->custom = array();');
@ -232,7 +232,7 @@ class PocketMinecraftServer{
public function eventHandler($data, $event){
switch($event){
case "player.new":
case "player.add":
console("[DEBUG] Player \"".$data["username"]."\" EID ".$data["eid"]." spawned at X ".$data["x"]." Y ".$data["y"]." Z ".$data["z"], true, true, 2);
break;
}