From 9ef2dc6fe146e975520e400c02f387dcae8da7e6 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 30 Jan 2013 20:49:34 +0100 Subject: [PATCH] Small changes, Ellie --- src/classes/Player.php | 4 ++-- src/classes/PocketMinecraftServer.php | 2 +- src/classes/world/Entity.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/classes/Player.php b/src/classes/Player.php index 29922b627..01eb28948 100644 --- a/src/classes/Player.php +++ b/src/classes/Player.php @@ -92,7 +92,7 @@ class Player{ } public function save(){ - if(is_object($this->entity)){ + if($this->entity instanceof Entity){ $this->data["spawn"] = array( "x" => $this->entity->x, "y" => $this->entity->y, @@ -521,7 +521,7 @@ class Player{ } break; 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->server->api->dhandle("player.move", $this->entity); } diff --git a/src/classes/PocketMinecraftServer.php b/src/classes/PocketMinecraftServer.php index 636015d0c..e954af0ba 100644 --- a/src/classes/PocketMinecraftServer.php +++ b/src/classes/PocketMinecraftServer.php @@ -101,7 +101,7 @@ class PocketMinecraftServer{ $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();'); - 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 * 120, '$this->debugInfo(true);'); diff --git a/src/classes/world/Entity.php b/src/classes/world/Entity.php index ff9b4476f..9d21c6248 100644 --- a/src/classes/world/Entity.php +++ b/src/classes/world/Entity.php @@ -319,7 +319,7 @@ class Entity extends stdClass{ } public function spawn($player){ - if(!is_object($player)){ + if(!($player instanceof Player)){ $player = $this->server->api->player->get($player); } if($player->eid === $this->eid){