Small changes, Ellie

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-30 20:49:34 +01:00
parent d0a08d16e7
commit 9ef2dc6fe1
3 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,7 @@ class Player{
} }
public function save(){ public function save(){
if(is_object($this->entity)){ if($this->entity instanceof Entity){
$this->data["spawn"] = array( $this->data["spawn"] = array(
"x" => $this->entity->x, "x" => $this->entity->x,
"y" => $this->entity->y, "y" => $this->entity->y,
@ -521,7 +521,7 @@ class Player{
} }
break; break;
case MC_MOVE_PLAYER: case MC_MOVE_PLAYER:
if(is_object($this->entity)){ if($this->entity instanceof Entity){
$this->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]); $this->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]);
$this->server->api->dhandle("player.move", $this->entity); $this->server->api->dhandle("player.move", $this->entity);
} }

View File

@ -101,7 +101,7 @@ class PocketMinecraftServer{
$this->action(5000000, 'if($this->difficulty < 2){$this->api->dhandle("server.regeneration", 1);}'); $this->action(5000000, 'if($this->difficulty < 2){$this->api->dhandle("server.regeneration", 1);}');
$this->action(1000000 * 60, '$this->reloadConfig();'); $this->action(1000000 * 60, '$this->reloadConfig();');
$this->action(1000000 * 60 * 10, '$this->custom = array();'); $this->action(1000000 * 60 * 10, '$this->custom = array();');
if($this->api !== false){ if($this->api instanceof ServerAPI){
$this->action(1000000 * 80, '$cnt = count($this->clients); if($cnt > 1){$this->api->chat->broadcast("Online (".$cnt."): ".implode(", ",$this->api->player->online()));}'); $this->action(1000000 * 80, '$cnt = count($this->clients); if($cnt > 1){$this->api->chat->broadcast("Online (".$cnt."): ".implode(", ",$this->api->player->online()));}');
} }
$this->action(1000000 * 120, '$this->debugInfo(true);'); $this->action(1000000 * 120, '$this->debugInfo(true);');

View File

@ -319,7 +319,7 @@ class Entity extends stdClass{
} }
public function spawn($player){ public function spawn($player){
if(!is_object($player)){ if(!($player instanceof Player)){
$player = $this->server->api->player->get($player); $player = $this->server->api->player->get($player);
} }
if($player->eid === $this->eid){ if($player->eid === $this->eid){