Entity and TileEntity saving

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-27 21:33:57 +01:00
parent 5c11f48270
commit 2cb7a21b76
3 changed files with 107 additions and 14 deletions

View file

@ -45,6 +45,9 @@ class TileEntity extends stdClass{
$this->class = (int) $class;
$this->data = $data;
$this->closed = false;
if($class === false){
$this->closed = true;
}
$this->name = "";
$this->id = (int) $id;
$this->x = (int) $x;
@ -68,6 +71,9 @@ class TileEntity extends stdClass{
}
public function spawn($player){
if($this->closed){
return false;
}
if(!($player instanceof Player)){
$player = $this->server->api->player->get($player);
}